diff --git a/src/js/messaging.js b/src/js/messaging.js index 59abacf..5b29174 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -146,17 +146,19 @@ var matrixSnapshot = function(pageStore, details) { domain: pageStore.pageDomain, headers: µm.Matrix.getColumnHeaders(), hostname: pageStore.pageHostname, - mtxColorModified: µm.tMatrix.modifiedTime !== details.mtxColorModifiedTime, mtxContentModified: pageStore.mtxContentModifiedTime !== details.mtxContentModifiedTime, mtxCountModified: pageStore.mtxCountModifiedTime !== details.mtxCountModifiedTime, - mtxColorModifiedTime: µm.tMatrix.modifiedTime, mtxContentModifiedTime: pageStore.mtxContentModifiedTime, mtxCountModifiedTime: pageStore.mtxCountModifiedTime, + pMatrixModified: µm.pMatrix.modifiedTime !== details.pMatrixModifiedTime, + pMatrixModifiedTime: µm.pMatrix.modifiedTime, pSwitches: {}, rows: {}, rowCount: 0, scope: '*', tabId: pageStore.tabId, + tMatrixModified: µm.tMatrix.modifiedTime !== details.tMatrixModifiedTime, + tMatrixModifiedTime: µm.tMatrix.modifiedTime, tSwitches: {}, url: pageStore.pageUrl, userSettings: { @@ -264,7 +266,8 @@ var matrixSnapshotFromTabId = function(details, callback) { // First verify whether we must return data or not. if ( - µm.tMatrix.modifiedTime === details.mtxColorModifiedTime && + µm.tMatrix.modifiedTime === details.tMatrixModifiedTime && + µm.pMatrix.modifiedTime === details.pMatrixModifiedTime && pageStore.mtxContentModifiedTime === details.mtxContentModifiedTime && pageStore.mtxCountModifiedTime === details.mtxCountModifiedTime ) { diff --git a/src/js/popup.js b/src/js/popup.js index 9f3f0c4..f314e08 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -973,18 +973,21 @@ function initMenuEnvironment() { function selectGlobalScope() { setUserSetting('popupScopeLevel', '*'); + matrixSnapshot.tMatrixModifiedTime = undefined; updateMatrixSnapshot(); dropDownMenuHide(); } function selectDomainScope() { setUserSetting('popupScopeLevel', 'domain'); + matrixSnapshot.tMatrixModifiedTime = undefined; updateMatrixSnapshot(); dropDownMenuHide(); } function selectSiteScope() { setUserSetting('popupScopeLevel', 'site'); + matrixSnapshot.tMatrixModifiedTime = undefined; updateMatrixSnapshot(); dropDownMenuHide(); } @@ -1196,7 +1199,8 @@ var matrixSnapshotPoller = (function() { if ( response.mtxContentModified === false && response.mtxCountModified === false && - response.mtxColorModified === false + response.pMatrixModified === false && + response.tMatrixModified === false ) { return; } @@ -1208,7 +1212,11 @@ var matrixSnapshotPoller = (function() { if ( response.mtxCountModified ) { updateMatrixCounts(); } - if ( response.mtxColorModified ) { + if ( + response.pMatrixModified || + response.tMatrixModified || + response.scopeModified + ) { updateMatrixColors(); updateMatrixBehavior(); updateMatrixButtons(); @@ -1225,9 +1233,11 @@ var matrixSnapshotPoller = (function() { messager.send({ what: 'matrixSnapshot', tabId: matrixSnapshot.tabId, - mtxColorModifiedTime: matrixSnapshot.mtxColorModifiedTime, mtxContentModifiedTime: matrixSnapshot.mtxContentModifiedTime, - mtxCountModifiedTime: matrixSnapshot.mtxCountModifiedTime + mtxCountModifiedTime: matrixSnapshot.mtxCountModifiedTime, + mtxDiffCount: matrixSnapshot.diff.length, + pMatrixModifiedTime: matrixSnapshot.pMatrixModifiedTime, + tMatrixModifiedTime: matrixSnapshot.tMatrixModifiedTime, }, onPolled); };