Committed by
Gerrit Code Review
ONOS-2901 - Added fix to ignore reserved global keys, when activating a topo overlay.
Change-Id: I9bcd15e4a5e6d688683e0ac703328dc4f840c461
Showing
2 changed files
with
22 additions
and
1 deletions
... | @@ -173,6 +173,23 @@ | ... | @@ -173,6 +173,23 @@ |
173 | keyHandler.viewGestures = []; | 173 | keyHandler.viewGestures = []; |
174 | } | 174 | } |
175 | 175 | ||
176 | + function checkNotGlobal(o) { | ||
177 | + var oops = []; | ||
178 | + if (fs.isO(o)) { | ||
179 | + angular.forEach(o, function (val, key) { | ||
180 | + if (keyHandler.globalKeys[key]) { | ||
181 | + oops.push(key); | ||
182 | + } | ||
183 | + }); | ||
184 | + if (oops.length) { | ||
185 | + $log.warn('Ignoring reserved global key(s):', oops.join(',')); | ||
186 | + oops.forEach(function (key) { | ||
187 | + delete o[key]; | ||
188 | + }); | ||
189 | + } | ||
190 | + } | ||
191 | + } | ||
192 | + | ||
176 | angular.module('onosUtil') | 193 | angular.module('onosUtil') |
177 | .factory('KeyService', | 194 | .factory('KeyService', |
178 | ['$log', 'FnService', 'ThemeService', 'NavService', | 195 | ['$log', 'FnService', 'ThemeService', 'NavService', |
... | @@ -208,7 +225,8 @@ | ... | @@ -208,7 +225,8 @@ |
208 | }, | 225 | }, |
209 | enableKeys: function (b) { | 226 | enableKeys: function (b) { |
210 | enabled = b; | 227 | enabled = b; |
211 | - } | 228 | + }, |
229 | + checkNotGlobal: checkNotGlobal | ||
212 | }; | 230 | }; |
213 | }]); | 231 | }]); |
214 | 232 | ... | ... |
... | @@ -95,6 +95,9 @@ | ... | @@ -95,6 +95,9 @@ |
95 | // and include them in the quick-help panel | 95 | // and include them in the quick-help panel |
96 | function mergeKeys(extra) { | 96 | function mergeKeys(extra) { |
97 | var _hf = actionMap._helpFormat[2]; | 97 | var _hf = actionMap._helpFormat[2]; |
98 | + | ||
99 | + ks.checkNotGlobal(extra); | ||
100 | + | ||
98 | extra._keyOrder.forEach(function (k) { | 101 | extra._keyOrder.forEach(function (k) { |
99 | var d = extra[k], | 102 | var d = extra[k], |
100 | cb = d && d.cb, | 103 | cb = d && d.cb, | ... | ... |
-
Please register or login to post a comment