diff --git a/static/js/pad.js b/static/js/pad.js index bda68956e..10f62e399 100644 --- a/static/js/pad.js +++ b/static/js/pad.js @@ -644,13 +644,6 @@ var pad = { paduserlist.removeGuestPrompt(msg.guestId); } }, - editbarClick: function(cmd) - { - if (padeditbar) - { - padeditbar.toolbarClick(cmd); - } - }, dmesg: function(m) { if (pad.getIsDebugEnabled()) diff --git a/static/js/pad_editbar.js b/static/js/pad_editbar.js index 236926310..f7cd9aae6 100644 --- a/static/js/pad_editbar.js +++ b/static/js/pad_editbar.js @@ -97,8 +97,15 @@ var padeditbar = (function() var self = { init: function() { + var self = this; $("#editbar .editbarbutton").attr("unselectable", "on"); // for IE $("#editbar").removeClass("disabledtoolbar").addClass("enabledtoolbar"); + $("#editbar [data-key]").each(function (i, e) { + $(e).click(function (event) { + self.toolbarClick($(e).attr('data-key')); + event.preventDefault(); + }); + }); }, isEnabled: function() { diff --git a/static/pad.html b/static/pad.html index 4c6d4d8cf..c336d6662 100644 --- a/static/pad.html +++ b/static/pad.html @@ -15,58 +15,58 @@