From 98d2d8c1cc1e0d7842210b3b7f98bd73aaa46be2 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 26 Feb 2012 00:11:24 +0100 Subject: Simplify Aloha Editor handling. --- static/js/wiki.js | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/static/js/wiki.js b/static/js/wiki.js index 5deab10..6baf629 100644 --- a/static/js/wiki.js +++ b/static/js/wiki.js @@ -18,26 +18,8 @@ mulk.savePage = function() { console.log('Error saving content.'); } }); - $('#wiki-page-content').removeAttr('contenteditable'); }; -/* -jQuery(function ($) { - $('#wiki-page-content').on('blur', function() { - mulk.savePage(); - document.designMode = 'off'; - }); - $('body').on('click', function() { - mulk.savePage(); - document.designMode = 'off'; - }); - $('#wiki-page-content').on('dblclick', function() { - document.designMode = 'on'; - }); -}); -*/ - - jQuery(function ($) { if (!window.Aloha) { window.Aloha = {}; @@ -76,17 +58,12 @@ jQuery(function ($) { Aloha.ready(function() { var $$ = Aloha.jQuery; - var editable; - $$('#wiki-page-content').aloha(); - editable = Aloha.editables[0]; - editable.disable(); $('#wiki-page-content').on('blur', function() { mulk.savePage(); - editable.disable(); + $$('#wiki-page-content').mahalo(); }); $('#wiki-page-content').dblclick(function() { - editable.enable(); + $$('#wiki-page-content').aloha(); }); }); }); - -- cgit v1.2.3