According to Aloha editor’s docs, you can listen to the “aloha-smart-content-changed” event to get help, say, to save data in any save mechanism you use. Here is an example of what I'm trying to do:
<html> <head> <title>Aloha Event Testing</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script src="http://cdn.aloha-editor.org/current/lib/aloha.js" data-aloha-plugins="common/format, common/list, common/link, common/highlighteditables"></script> <link href="http://cdn.aloha-editor.org/current/css/aloha.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> Aloha.ready( function() { var $ = Aloha.jQuery; $('.editable').aloha(); }); $(document).ready(function() { $('.editable').bind('aloha-smart-content-changed', function() { console.log('Aloha smart event handled.'); }); }); </script> </head> <body> <div class="editable"></div> </body> </html>
But the handler never fires. Does anyone who worked with Aloha know how to listen to the event?
source share