From 3c0cf7c97717789282b0d4dca1a6d8f89e9777aa Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Mon, 1 Dec 2014 15:00:43 +0100 Subject: [PATCH] [FIX] website_forum: restore bind to onclick because CKE Editor uses it, so on('click', fun) breaks things. Fixes bugs with z-index error on some popups (image selector for example...) --- .../static/src/js/website_forum.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 47ff619815d..1e2e2a44f5f 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -217,20 +217,20 @@ editor.on('instanceReady', CKEDITORLoadComplete); } - function IsKarmaValid(eventNumber, minKarma){ - "use strict"; - if(parseInt($("#karma").val()) >= minKarma){ - CKEDITOR.tools.callFunction(eventNumber,this); - return false; - } else { - alert("Sorry you need more than " + minKarma + " Karma."); - } - } - function CKEDITORLoadComplete(){ "use strict"; - $('.cke_button__link').on('click', function() { IsKarmaValid(33,30); }); - $('.cke_button__unlink').on('click', function() { IsKarmaValid(37,30); }); - $('.cke_button__image').on('click', function() { IsKarmaValid(41,30); }); + $('.cke_button__link').attr('onclick','website_forum_IsKarmaValid(33,30)'); + $('.cke_button__unlink').attr('onclick','website_forum_IsKarmaValid(37,30)'); + $('.cke_button__image').attr('onclick','website_forum_IsKarmaValid(41,30)'); } }); + + function website_forum_IsKarmaValid(eventNumber, minKarma){ + "use strict"; + if(parseInt($("#karma").val()) >= minKarma){ + CKEDITOR.tools.callFunction(eventNumber, this); + return false; + } else { + alert("Sorry you need more than " + minKarma + " Karma."); + } + }