mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 923086 - "Add to reading list" button does not save it's state, r=lucasr
Part 1 - Ensure readinglist banner not visible until state is finalized
This commit is contained in:
parent
7764c3273e
commit
4dd7549869
@ -123,7 +123,7 @@ let AboutReader = function(doc, win) {
|
||||
this._updateToggleButton();
|
||||
|
||||
// Track status of reader toolbar list button
|
||||
this._readingListCount = 0;
|
||||
this._readingListCount = -1;
|
||||
this._updateListButton();
|
||||
this._requestReadingListCount();
|
||||
|
||||
@ -214,8 +214,14 @@ AboutReader.prototype = {
|
||||
case "Reader:ListCountUpdated": {
|
||||
let count = parseInt(aData);
|
||||
if (this._readingListCount != count) {
|
||||
let isInitialStateChange = (this._readingListCount == -1);
|
||||
this._readingListCount = count;
|
||||
this._updateListButton();
|
||||
|
||||
// Display the toolbar when all its initial component states are known
|
||||
if (isInitialStateChange) {
|
||||
this._setToolbarVisibility(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -324,7 +330,7 @@ AboutReader.prototype = {
|
||||
},
|
||||
|
||||
_onList: function Reader_onList() {
|
||||
if (!this._article || this._readingListCount == 0)
|
||||
if (!this._article || this._readingListCount < 1)
|
||||
return;
|
||||
|
||||
gChromeWin.sendMessageToJava({ type: "Reader:GoToReadingList" });
|
||||
@ -455,6 +461,10 @@ AboutReader.prototype = {
|
||||
if (!this._toolbarEnabled)
|
||||
return;
|
||||
|
||||
// Don't allow visible toolbar until banner state is known
|
||||
if (this._readingListCount == -1)
|
||||
return;
|
||||
|
||||
if (this._getToolbarVisibility() === visible)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user