зеркало из https://github.com/mozilla/gecko-dev.git
Bug 886573 - make zoom controls display the right thing in Australis even in customize mode, r=jaws
This commit is contained in:
Родитель
8c77ec6ab5
Коммит
816d891ffc
|
@ -416,6 +416,11 @@ const CustomizableWidgets = [{
|
|||
let zoomResetButton = node.childNodes[2];
|
||||
let window = aDocument.defaultView;
|
||||
function updateZoomResetButton() {
|
||||
let updateDisplay = true;
|
||||
// Label should always show 100% in customize mode, so don't update:
|
||||
if (aDocument.documentElement.hasAttribute("customizing")) {
|
||||
updateDisplay = false;
|
||||
}
|
||||
//XXXgijs in some tests we get called very early, and there's no docShell on the
|
||||
// tabbrowser. This breaks the zoom toolkit code (see bug 897410). Don't let that happen:
|
||||
let zoomFactor = 100;
|
||||
|
@ -423,7 +428,7 @@ const CustomizableWidgets = [{
|
|||
zoomFactor = Math.floor(window.ZoomManager.zoom * 100);
|
||||
} catch (e) {}
|
||||
zoomResetButton.setAttribute("label", CustomizableUI.getLocalizedProperty(
|
||||
buttons[1], "label", [zoomFactor]
|
||||
buttons[1], "label", [updateDisplay ? zoomFactor : 100]
|
||||
));
|
||||
};
|
||||
|
||||
|
@ -508,6 +513,18 @@ const CustomizableWidgets = [{
|
|||
container.removeEventListener("TabSelect", updateZoomResetButton);
|
||||
}.bind(this),
|
||||
|
||||
onCustomizeStart: function(aWindow) {
|
||||
if (aWindow.document == aDocument) {
|
||||
updateZoomResetButton();
|
||||
}
|
||||
},
|
||||
|
||||
onCustomizeEnd: function(aWindow) {
|
||||
if (aWindow.document == aDocument) {
|
||||
updateZoomResetButton();
|
||||
}
|
||||
},
|
||||
|
||||
onWidgetDrag: function(aWidgetId, aArea) {
|
||||
if (aWidgetId != this.id)
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче