1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

fix "purge all" button not disabled when there is nothing left to purge

This commit is contained in:
gorhill 2017-05-26 08:31:19 -04:00
parent c77830995b
commit 8d2319e011
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 7 additions and 3 deletions

View File

@ -276,7 +276,10 @@ var renderFilterLists = function(soft) {
var renderWidgets = function() {
uDom('#buttonApply').toggleClass('disabled', filteringSettingsHash === hashFromCurrentFromSettings());
uDom('#buttonPurgeAll').toggleClass('disabled', document.querySelector('#lists .listEntry.cached') === null);
uDom('#buttonPurgeAll').toggleClass(
'disabled',
document.querySelector('#lists .listEntry.cached:not(.obsolete)') === null
);
uDom('#buttonUpdate').toggleClass('disabled', document.querySelector('body:not(.updating) #lists .listEntry.obsolete > input[type="checkbox"]:checked') === null);
};

View File

@ -75,13 +75,14 @@
return th;
},
// https://github.com/chrisaljoudi/uBlock/issues/1118
// We limit to a maximum number of tokens.
_tokenize: function() {
var tokens = this._tokens,
url = this._urlOut,
l = url.length;
if ( l === 0 ) { tokens[0] = 0; return; }
// https://github.com/chrisaljoudi/uBlock/issues/1118
// We limit to a maximum number of tokens.
if ( l > 2048 ) {
url = url.slice(0, 2048);
l = 2048;