Browse Source

fixed controls broken by incremental rendering

pull/2/head
gorhill 10 years ago
parent
commit
4142551c13
  1. 9
      src/js/messaging.js
  2. 18
      src/js/popup.js

9
src/js/messaging.js

@ -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
) { ) {

18
src/js/popup.js

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

Loading…
Cancel
Save