зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1287980 - fix combined toolbar button styling after undo reset, r=jaws
MozReview-Commit-ID: GnkIUIAByH7 --HG-- extra : rebase_source : 1fce678c641bb3461e7ee71b4cf61b0790ed1c3b
This commit is contained in:
Родитель
52b9ca33f3
Коммит
6fc19dc1e3
|
@ -665,12 +665,6 @@
|
|||
#endif
|
||||
</toolbar>
|
||||
|
||||
<!--
|
||||
CAVEAT EMPTOR
|
||||
Should you need to add items to the toolbar here, make sure to also add them
|
||||
to the default placements of buttons in CustomizableUI.jsm, so the
|
||||
customization code doesn't get confused.
|
||||
-->
|
||||
<toolbar id="nav-bar"
|
||||
aria-label="&navbarCmd.label;"
|
||||
fullscreentoolbar="true" mode="icons" customizable="true"
|
||||
|
|
|
@ -726,11 +726,12 @@ var CustomizableUIInternal = {
|
|||
continue;
|
||||
}
|
||||
|
||||
let widget = null;
|
||||
// If the placements have items in them which are (now) no longer removable,
|
||||
// we shouldn't be moving them:
|
||||
if (provider == CustomizableUI.PROVIDER_API) {
|
||||
let widgetInfo = gPalette.get(id);
|
||||
if (!widgetInfo.removable && aArea != widgetInfo.defaultArea) {
|
||||
widget = gPalette.get(id);
|
||||
if (!widget.removable && aArea != widget.defaultArea) {
|
||||
placementsToRemove.add(id);
|
||||
continue;
|
||||
}
|
||||
|
@ -740,11 +741,8 @@ var CustomizableUIInternal = {
|
|||
continue;
|
||||
} // Special widgets are always removable, so no need to check them
|
||||
|
||||
if (inPrivateWindow && provider == CustomizableUI.PROVIDER_API) {
|
||||
let widget = gPalette.get(id);
|
||||
if (!widget.showInPrivateBrowsing && inPrivateWindow) {
|
||||
continue;
|
||||
}
|
||||
if (inPrivateWindow && widget && !widget.showInPrivateBrowsing) {
|
||||
continue;
|
||||
}
|
||||
|
||||
this.ensureButtonContextMenu(node, aAreaNode);
|
||||
|
@ -756,6 +754,10 @@ var CustomizableUIInternal = {
|
|||
}
|
||||
}
|
||||
|
||||
// This needs updating in case we're resetting / undoing a reset.
|
||||
if (widget) {
|
||||
widget.currentArea = aArea;
|
||||
}
|
||||
this.insertWidgetBefore(node, currentNode, container, aArea);
|
||||
if (gResetting) {
|
||||
this.notifyListeners("onWidgetReset", node, container);
|
||||
|
|
|
@ -748,6 +748,13 @@ const CustomizableWidgets = [
|
|||
updateZoomResetButton();
|
||||
}.bind(this),
|
||||
|
||||
onWidgetUndoMove: function(aWidgetNode) {
|
||||
if (aWidgetNode != node)
|
||||
return;
|
||||
updateCombinedWidgetStyle(node, this.currentArea, true);
|
||||
updateZoomResetButton();
|
||||
}.bind(this),
|
||||
|
||||
onWidgetMoved: function(aWidgetId, aArea) {
|
||||
if (aWidgetId != this.id)
|
||||
return;
|
||||
|
@ -859,6 +866,12 @@ const CustomizableWidgets = [
|
|||
updateCombinedWidgetStyle(node, this.currentArea);
|
||||
}.bind(this),
|
||||
|
||||
onWidgetUndoMove: function(aWidgetNode) {
|
||||
if (aWidgetNode != node)
|
||||
return;
|
||||
updateCombinedWidgetStyle(node, this.currentArea);
|
||||
}.bind(this),
|
||||
|
||||
onWidgetMoved: function(aWidgetId, aArea) {
|
||||
if (aWidgetId != this.id)
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче