From fbbdddae8ee2f3aefb42c46f381b74e02bff87a7 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Wed, 29 Feb 2012 14:13:02 -0800 Subject: [PATCH] Remove onclick attributes from editbar. --- static/js/pad.js | 7 ------- static/js/pad_editbar.js | 7 +++++++ static/pad.html | 30 +++++++++++++++--------------- 3 files changed, 22 insertions(+), 22 deletions(-) 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 @@