disable updates when panel is hidden

This commit is contained in:
Dietmar Maurer 2011-11-08 14:27:46 +01:00
parent 2dacceb1d9
commit b78330d2a4

View File

@ -53,8 +53,11 @@ Ext.define('PVE.grig.LogView', {
// invalidate last page by removing last entry from cache // invalidate last page by removing last entry from cache
store.prefetchData.removeAtKey(store.totalCount - 1); store.prefetchData.removeAtKey(store.totalCount - 1);
store.guaranteeRange(store.totalCount - store.pageSize, var start = store.totalCount - store.pageSize;
store.totalCount - 1); if (start < 0) {
start = 0;
}
store.guaranteeRange(start, start + store.pageSize - 1);
}; };
var onScroll = function() { var onScroll = function() {
@ -110,11 +113,17 @@ Ext.define('PVE.grig.LogView', {
load_task.delay(1000, run_load_task); load_task.delay(1000, run_load_task);
}; };
if (me.scrollToEnd) { me.on('show', function() {
run_load_task(); if (me.scrollToEnd) {
} else { run_load_task();
store.guaranteeRange(0, store.pageSize - 1); } else {
} store.guaranteeRange(0, store.pageSize - 1);
}
});
me.on('hide', function() {
load_task.cancel();
});
me.on('destroy', function() { me.on('destroy', function() {
load_task.cancel(); load_task.cancel();