Skip to content

Commit 36a6ed1

Browse files
committed
Add isEnabled to keyboard API
1 parent 3742504 commit 36a6ed1

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

js/ui/keyboard.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ class Keyboard extends Disposable {
2929
this.isEnabled_ = true;
3030

3131
events.listen(
32-
this.shortcuts_,
32+
this.shortcuts_,
3333
KeyboardShortcutHandler.EventType.SHORTCUT_TRIGGERED,
34-
this.handleKeyboardShortcut,
35-
false,
34+
this.handleKeyboardShortcut,
35+
false,
3636
this);
3737

3838
/** @private @const @type {!Map<string,!Shortcut>} */
@@ -84,10 +84,18 @@ class Keyboard extends Disposable {
8484
this.shortcutMap_.clear();
8585
}
8686

87-
/**
88-
* Enable/disable the shotcuts globally.
89-
* @param {boolean} b
90-
*/
87+
/**
88+
* Return the isEnabled flag.
89+
* @return {boolean}
90+
*/
91+
isEnabled() {
92+
return this.isEnabled_;
93+
}
94+
95+
/**
96+
* Enable/disable the shotcuts globally.
97+
* @param {boolean} b
98+
*/
9199
setEnabled(b) {
92100
this.shortcuts_.unregisterAll();
93101
if (b) {

js/ui/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Router extends EventTarget {
6767
//console.log('go: ' + path);
6868
asserts.assertString(path, 'Routing path must be a string');
6969
if (this.route_) {
70-
console.warn(`cannot route to ${path} due to existing route`, this.route_);
70+
console.warn(`cannot route to ${path} due to existing route "${this.route_.matchedPath()}" --> "${this.route_.unmatchedPath()}"`);
7171
return Promise_.reject(
7272
'Already routing to ' + this.route_.getPath()
7373
);

0 commit comments

Comments
 (0)