From 51900cbf67d2db6e73e8e72768c9f31bfa23eab4 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sun, 16 Mar 2014 14:04:12 +0100 Subject: Toolbar: Allow custom dropdowns for plugins --- src/static/js/pad_editbar.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/static/js') diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index f4fda27c..7892a085 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -139,6 +139,8 @@ var padeditbar = (function() var self = { init: function() { var self = this; + self.dropdowns = []; + $("#editbar .editbarbutton").attr("unselectable", "on"); // for IE $("#editbar").removeClass("disabledtoolbar").addClass("enabledtoolbar"); $("#editbar [data-key]").each(function () { @@ -170,6 +172,7 @@ var padeditbar = (function() }, registerDropdownCommand: function (cmd, dropdown) { dropdown = dropdown || cmd; + self.dropdowns.push(dropdown) this.registerCommand(cmd, function () { self.toggleDropDown(dropdown); }); @@ -189,19 +192,17 @@ var padeditbar = (function() }, toggleDropDown: function(moduleName, cb) { - var modules = ["settings", "connectivity", "importexport", "embed", "users"]; - // hide all modules and remove highlighting of all buttons if(moduleName == "none") { var returned = false - for(var i=0;i