mirror of https://github.com/gorhill/uBlock.git
this fixes #345
This commit is contained in:
parent
eeca7cb41f
commit
41a90bd55e
|
@ -1534,14 +1534,25 @@ var toJunkyard = function(trs) {
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
var clearBuffer = function() {
|
var clearBuffer = function() {
|
||||||
|
var tabId = uDom.nodeFromId('pageSelector').value || null;
|
||||||
var tbody = document.querySelector('#content tbody');
|
var tbody = document.querySelector('#content tbody');
|
||||||
var tr;
|
var tr = tbody.lastElementChild;
|
||||||
while ( tbody.firstChild !== null ) {
|
var trPrevious;
|
||||||
tr = tbody.lastElementChild;
|
while ( tr !== null ) {
|
||||||
trJunkyard.push(tbody.removeChild(tr));
|
trPrevious = tr.previousElementSibling;
|
||||||
|
if ( tabId === null || tr.classList.contains(tabId) ) {
|
||||||
|
trJunkyard.push(tbody.removeChild(tr));
|
||||||
|
}
|
||||||
|
tr = trPrevious;
|
||||||
}
|
}
|
||||||
uDom('#clear').addClass('disabled');
|
uDom.nodeFromId('clear').classList.toggle(
|
||||||
uDom('#clean').addClass('disabled');
|
'disabled',
|
||||||
|
tbody.childElementCount === 0
|
||||||
|
);
|
||||||
|
uDom.nodeFromId('clean').classList.toggle(
|
||||||
|
'disabled',
|
||||||
|
tbody.querySelector('tr.tab:not(.canMtx)') === null
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue