Simon Hunt
Committed by Gerrit Code Review

ONOS-2901 - Added fix to ignore reserved global keys, when activating a topo overlay.

Change-Id: I9bcd15e4a5e6d688683e0ac703328dc4f840c461
......@@ -173,6 +173,23 @@
keyHandler.viewGestures = [];
}
function checkNotGlobal(o) {
var oops = [];
if (fs.isO(o)) {
angular.forEach(o, function (val, key) {
if (keyHandler.globalKeys[key]) {
oops.push(key);
}
});
if (oops.length) {
$log.warn('Ignoring reserved global key(s):', oops.join(','));
oops.forEach(function (key) {
delete o[key];
});
}
}
}
angular.module('onosUtil')
.factory('KeyService',
['$log', 'FnService', 'ThemeService', 'NavService',
......@@ -208,7 +225,8 @@
},
enableKeys: function (b) {
enabled = b;
}
},
checkNotGlobal: checkNotGlobal
};
}]);
......
......@@ -95,6 +95,9 @@
// and include them in the quick-help panel
function mergeKeys(extra) {
var _hf = actionMap._helpFormat[2];
ks.checkNotGlobal(extra);
extra._keyOrder.forEach(function (k) {
var d = extra[k],
cb = d && d.cb,
......