Merge branch 'patch-1' of https://github.com/Blaisorblade/ingress-intel-total-conversion
This commit is contained in:
commit
c3bc255691
@ -119,19 +119,24 @@ window.plugin.sync.RegisteredMap.prototype.updateMap = function(keyArray) {
|
||||
var _this = this;
|
||||
// Use compound operation to ensure update pushed as a batch
|
||||
this.model.beginCompoundOperation();
|
||||
// Remove before set text to ensure full text change
|
||||
this.lastUpdateUUID.removeRange(0, this.lastUpdateUUID.length);
|
||||
this.lastUpdateUUID.setText(this.uuid);
|
||||
|
||||
$.each(keyArray, function(ind, key) {
|
||||
var value = window.plugin[_this.pluginName][_this.fieldName][key];
|
||||
if(typeof(value) !== 'undefined') {
|
||||
_this.map.set(key, value);
|
||||
} else {
|
||||
_this.map.delete(key);
|
||||
}
|
||||
});
|
||||
this.model.endCompoundOperation();
|
||||
try {
|
||||
// Remove before set text to ensure full text change
|
||||
if (this.lastUpdateUUID.length > 0)
|
||||
this.lastUpdateUUID.removeRange(0, this.lastUpdateUUID.length);
|
||||
this.lastUpdateUUID.setText(this.uuid);
|
||||
|
||||
$.each(keyArray, function(ind, key) {
|
||||
var value = window.plugin[_this.pluginName][_this.fieldName][key];
|
||||
if(typeof(value) !== 'undefined') {
|
||||
_this.map.set(key, value);
|
||||
} else {
|
||||
_this.map.delete(key);
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
// Ensure endCompoundOperation is always called (see bug #896)
|
||||
this.model.endCompoundOperation();
|
||||
}
|
||||
}
|
||||
|
||||
window.plugin.sync.RegisteredMap.prototype.isUpdatedByOthers = function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user