Bug 969661 - always re-enable Australis character encoding button when it is removed from an area, r=jaws

--HG--
extra : rebase_source : 5c3cc7cbf7c857ec7aaced350aa8864c9cd939ba
This commit is contained in:
Gijs Kruitbosch 2014-02-08 00:06:55 +00:00
parent 085446242d
commit 3e73d4d7ac
3 changed files with 28 additions and 0 deletions

View File

@ -794,6 +794,7 @@ const CustomizableWidgets = [{
onWidgetRemoved: (aWidgetId, aPrevArea) => {
if (aWidgetId != this.id)
return;
aNode.removeAttribute("disabled");
if (aPrevArea == CustomizableUI.AREA_PANEL) {
let panel = document.getElementById(kPanelId);
panel.removeEventListener("popupshowing", updateButton);

View File

@ -63,4 +63,5 @@ skip-if = os == "linux"
[browser_948985_non_removable_defaultArea.js]
[browser_952963_areaType_getter_no_area.js]
[browser_956602_remove_special_widget.js]
[browser_969661_character_encoding_navbar_disabled.js]
[browser_panel_toggle.js]

View File

@ -0,0 +1,26 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
// Adding the character encoding menu to the panel, exiting customize mode,
// and moving it to the nav-bar should have it enabled, not disabled.
add_task(function() {
yield startCustomizing();
CustomizableUI.addWidgetToArea("characterencoding-button", "PanelUI-contents");
yield endCustomizing();
yield PanelUI.show();
let panelHiddenPromise = promisePanelHidden(window);
PanelUI.hide();
yield panelHiddenPromise;
CustomizableUI.addWidgetToArea("characterencoding-button", 'nav-bar');
let button = document.getElementById("characterencoding-button");
ok(!button.hasAttribute("disabled"), "Button shouldn't be disabled");
});
add_task(function asyncCleanup() {
resetCustomization();
});