mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-07 07:37:11 -04:00
Now that buttons are where clicks start use delegation to handle click.
This commit is contained in:
parent
17b9fa4f36
commit
5b4b441697
1 changed files with 3 additions and 5 deletions
|
@ -100,11 +100,9 @@ var padeditbar = (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();
|
||||
});
|
||||
$("#editbar").delegate('[data-key] > button', 'click', function (event) {
|
||||
self.toolbarClick(($(event.currentTarget).parent()).attr('data-key'));
|
||||
event.preventDefault();
|
||||
});
|
||||
},
|
||||
isEnabled: function()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue