Don't notify when context was not changed
this will save some work on invalidating toolbars Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I2d20a2a490c99ff9e4b1852d551b4d3ec37abd1c
This commit is contained in:
parent
d21caf6937
commit
e3498c4ff6
1 changed files with 8 additions and 2 deletions
|
@ -1498,8 +1498,14 @@ L.CanvasTileLayer = L.Layer.extend({
|
|||
message = message.split(' ');
|
||||
if (message.length > 1) {
|
||||
var old = this._map.context || {};
|
||||
this._map.context = {appId: message[0], context: message[1]};
|
||||
this._map.fire('contextchange', {appId: message[0], context: message[1], oldAppId: old.appId, oldContext: old.context});
|
||||
var newContext = {appId: message[0], context: message[1]};
|
||||
if (old.appId !== newContext.appId || old.context !== newContext.context) {
|
||||
this._map.context = newContext;
|
||||
this._map.fire('contextchange', {
|
||||
appId: newContext.appId, context: newContext.context,
|
||||
oldAppId: old.appId, oldContext: old.context
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (textMsg.startsWith('formfieldbutton:')) {
|
||||
|
|
Loading…
Reference in a new issue