Bug 1396085 - ensure the sync widget is always initialized and animate the sync spinner. r=Gijs

MozReview-Commit-ID: HcAuLZQ95EH

--HG--
extra : rebase_source : 662020814200e4b389d7a07d508a76de0dcd989e
This commit is contained in:
Mark Hammond 2017-09-05 15:08:17 +10:00
Родитель 2dd8bf74ac
Коммит dd24896f66
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -256,6 +256,12 @@ const CustomizableWidgets = [
TABS_PER_PAGE: 25,
NEXT_PAGE_MIN_TABS: 5, // Minimum number of tabs displayed when we click "Show All"
onCreated(aNode) {
this._initialize(aNode);
},
_initialize(aNode) {
if (this._initialized) {
return;
}
// Add an observer to the button so we get the animation during sync.
// (Note the observer sets many attributes, including label and
// tooltiptext, but we only want the 'syncstatus' attribute for the
@ -300,8 +306,10 @@ const CustomizableWidgets = [
doc.defaultView.openUILinkIn(link, "tab");
CustomizableUI.hidePanelForNode(e.target);
});
this._initialized = true;
},
onViewShowing(aEvent) {
this._initialize(aEvent.target);
let doc = aEvent.target.ownerDocument;
this._tabsList = doc.getElementById("PanelUI-remotetabs-tabslist");
Services.obs.addObserver(this, SyncedTabs.TOPIC_TABS_CHANGED);

Просмотреть файл

@ -805,7 +805,8 @@ toolbaritem[cui-areatype="menu-panel"][sdkstylewidget="true"]:not(.panel-wide-it
to { transform: rotate(360deg); }
}
#appMenu-fxa-icon[syncstatus="active"] > .toolbarbutton-icon {
#appMenu-fxa-icon[syncstatus="active"] > .toolbarbutton-icon,
#PanelUI-remotetabs-syncnow[syncstatus="active"] > .toolbarbutton-icon {
animation: syncRotate 0.8s linear infinite;
fill: #0a84ff;
}