www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 806259d18777444ded91ba12c9225eefca89557d
parent 6b8cc59beaed2e9dbebb798bc0cbdfe753507c8a
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 27 Feb 2015 17:41:36 -0500

When dropping combo buttons into panel, add two separate buttons instead

And move combo button to customization palette

Diffstat:
Mchrome/content/zotero/icon.js | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/icon.js b/chrome/content/zotero/icon.js @@ -32,6 +32,21 @@ var comboButtonsID = 'zotero-toolbar-buttons'; CustomizableUI.addListener({ onWidgetAdded: function (id, area, position) { if (id == comboButtonsID) { + // When dropping combo button into panel, add two independent buttons instead + if (area == CustomizableUI.AREA_PANEL) { + let mainID = getSingleID('main'); + let saveID = getSingleID('save'); + CustomizableUI.removeWidgetFromArea(id); + // Remove independent main and save buttons first if they're already in panel + CustomizableUI.removeWidgetFromArea(mainID); + CustomizableUI.removeWidgetFromArea(saveID); + CustomizableUI.addWidgetToArea(mainID, area, position); + let placement = CustomizableUI.getPlacementOfWidget(mainID) + let mainPos = placement.position; + CustomizableUI.addWidgetToArea(saveID, area, mainPos + 1); + return; + } + var item = document.getElementById(id); // Element may not exist yet if it was added to the panel if (item) {