This commit is contained in:
gorhill 2015-06-14 20:11:25 -04:00
parent eeca7cb41f
commit 41a90bd55e
1 changed files with 17 additions and 6 deletions

View File

@ -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
);
}; };
/******************************************************************************/ /******************************************************************************/