1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-26 10:01:08 +12:00

fixed controls broken by incremental rendering

This commit is contained in:
gorhill 2015-05-07 00:39:17 -04:00
parent f8c38177e2
commit 4142551c13
2 changed files with 20 additions and 7 deletions

View file

@ -146,17 +146,19 @@ var matrixSnapshot = function(pageStore, details) {
domain: pageStore.pageDomain, domain: pageStore.pageDomain,
headers: µm.Matrix.getColumnHeaders(), headers: µm.Matrix.getColumnHeaders(),
hostname: pageStore.pageHostname, hostname: pageStore.pageHostname,
mtxColorModified: µm.tMatrix.modifiedTime !== details.mtxColorModifiedTime,
mtxContentModified: pageStore.mtxContentModifiedTime !== details.mtxContentModifiedTime, mtxContentModified: pageStore.mtxContentModifiedTime !== details.mtxContentModifiedTime,
mtxCountModified: pageStore.mtxCountModifiedTime !== details.mtxCountModifiedTime, mtxCountModified: pageStore.mtxCountModifiedTime !== details.mtxCountModifiedTime,
mtxColorModifiedTime: µm.tMatrix.modifiedTime,
mtxContentModifiedTime: pageStore.mtxContentModifiedTime, mtxContentModifiedTime: pageStore.mtxContentModifiedTime,
mtxCountModifiedTime: pageStore.mtxCountModifiedTime, mtxCountModifiedTime: pageStore.mtxCountModifiedTime,
pMatrixModified: µm.pMatrix.modifiedTime !== details.pMatrixModifiedTime,
pMatrixModifiedTime: µm.pMatrix.modifiedTime,
pSwitches: {}, pSwitches: {},
rows: {}, rows: {},
rowCount: 0, rowCount: 0,
scope: '*', scope: '*',
tabId: pageStore.tabId, tabId: pageStore.tabId,
tMatrixModified: µm.tMatrix.modifiedTime !== details.tMatrixModifiedTime,
tMatrixModifiedTime: µm.tMatrix.modifiedTime,
tSwitches: {}, tSwitches: {},
url: pageStore.pageUrl, url: pageStore.pageUrl,
userSettings: { userSettings: {
@ -264,7 +266,8 @@ var matrixSnapshotFromTabId = function(details, callback) {
// First verify whether we must return data or not. // First verify whether we must return data or not.
if ( if (
µm.tMatrix.modifiedTime === details.mtxColorModifiedTime && µm.tMatrix.modifiedTime === details.tMatrixModifiedTime &&
µm.pMatrix.modifiedTime === details.pMatrixModifiedTime &&
pageStore.mtxContentModifiedTime === details.mtxContentModifiedTime && pageStore.mtxContentModifiedTime === details.mtxContentModifiedTime &&
pageStore.mtxCountModifiedTime === details.mtxCountModifiedTime pageStore.mtxCountModifiedTime === details.mtxCountModifiedTime
) { ) {

View file

@ -973,18 +973,21 @@ function initMenuEnvironment() {
function selectGlobalScope() { function selectGlobalScope() {
setUserSetting('popupScopeLevel', '*'); setUserSetting('popupScopeLevel', '*');
matrixSnapshot.tMatrixModifiedTime = undefined;
updateMatrixSnapshot(); updateMatrixSnapshot();
dropDownMenuHide(); dropDownMenuHide();
} }
function selectDomainScope() { function selectDomainScope() {
setUserSetting('popupScopeLevel', 'domain'); setUserSetting('popupScopeLevel', 'domain');
matrixSnapshot.tMatrixModifiedTime = undefined;
updateMatrixSnapshot(); updateMatrixSnapshot();
dropDownMenuHide(); dropDownMenuHide();
} }
function selectSiteScope() { function selectSiteScope() {
setUserSetting('popupScopeLevel', 'site'); setUserSetting('popupScopeLevel', 'site');
matrixSnapshot.tMatrixModifiedTime = undefined;
updateMatrixSnapshot(); updateMatrixSnapshot();
dropDownMenuHide(); dropDownMenuHide();
} }
@ -1196,7 +1199,8 @@ var matrixSnapshotPoller = (function() {
if ( if (
response.mtxContentModified === false && response.mtxContentModified === false &&
response.mtxCountModified === false && response.mtxCountModified === false &&
response.mtxColorModified === false response.pMatrixModified === false &&
response.tMatrixModified === false
) { ) {
return; return;
} }
@ -1208,7 +1212,11 @@ var matrixSnapshotPoller = (function() {
if ( response.mtxCountModified ) { if ( response.mtxCountModified ) {
updateMatrixCounts(); updateMatrixCounts();
} }
if ( response.mtxColorModified ) { if (
response.pMatrixModified ||
response.tMatrixModified ||
response.scopeModified
) {
updateMatrixColors(); updateMatrixColors();
updateMatrixBehavior(); updateMatrixBehavior();
updateMatrixButtons(); updateMatrixButtons();
@ -1225,9 +1233,11 @@ var matrixSnapshotPoller = (function() {
messager.send({ messager.send({
what: 'matrixSnapshot', what: 'matrixSnapshot',
tabId: matrixSnapshot.tabId, tabId: matrixSnapshot.tabId,
mtxColorModifiedTime: matrixSnapshot.mtxColorModifiedTime,
mtxContentModifiedTime: matrixSnapshot.mtxContentModifiedTime, mtxContentModifiedTime: matrixSnapshot.mtxContentModifiedTime,
mtxCountModifiedTime: matrixSnapshot.mtxCountModifiedTime mtxCountModifiedTime: matrixSnapshot.mtxCountModifiedTime,
mtxDiffCount: matrixSnapshot.diff.length,
pMatrixModifiedTime: matrixSnapshot.pMatrixModifiedTime,
tMatrixModifiedTime: matrixSnapshot.tMatrixModifiedTime,
}, onPolled); }, onPolled);
}; };