mirror of https://github.com/gorhill/uBlock.git
fix "purge all" button not disabled when there is nothing left to purge
This commit is contained in:
parent
c77830995b
commit
8d2319e011
|
@ -276,7 +276,10 @@ var renderFilterLists = function(soft) {
|
||||||
|
|
||||||
var renderWidgets = function() {
|
var renderWidgets = function() {
|
||||||
uDom('#buttonApply').toggleClass('disabled', filteringSettingsHash === hashFromCurrentFromSettings());
|
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);
|
uDom('#buttonUpdate').toggleClass('disabled', document.querySelector('body:not(.updating) #lists .listEntry.obsolete > input[type="checkbox"]:checked') === null);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -75,13 +75,14 @@
|
||||||
return th;
|
return th;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// https://github.com/chrisaljoudi/uBlock/issues/1118
|
||||||
|
// We limit to a maximum number of tokens.
|
||||||
|
|
||||||
_tokenize: function() {
|
_tokenize: function() {
|
||||||
var tokens = this._tokens,
|
var tokens = this._tokens,
|
||||||
url = this._urlOut,
|
url = this._urlOut,
|
||||||
l = url.length;
|
l = url.length;
|
||||||
if ( l === 0 ) { tokens[0] = 0; return; }
|
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 ) {
|
if ( l > 2048 ) {
|
||||||
url = url.slice(0, 2048);
|
url = url.slice(0, 2048);
|
||||||
l = 2048;
|
l = 2048;
|
||||||
|
|
Loading…
Reference in New Issue