Commit b181a774 authored by fukino's avatar fukino Committed by Commit bot

Files.app: Reset hidden state of default commands when input elements are focused.

paste command's hidden property is set true when one directory is focused.
However, it will not be reset when an input is focused just after on directory is focused,
because different handler (forceDefaultHandler) handles canExecute event when inputs are focused.
All cut/copy/paste/delete commands should be shown in input element,
so this CL reset the hidden property of them.

BUG=528843
TEST=manually tested on rename input, search input, and filename input on save-as dialog.

Review URL: https://codereview.chromium.org/1312583009

Cr-Commit-Position: refs/heads/master@{#347870}
parent 2514eb9b
...@@ -219,8 +219,10 @@ CommandUtil.forceDefaultHandler = function(node, commandId) { ...@@ -219,8 +219,10 @@ CommandUtil.forceDefaultHandler = function(node, commandId) {
event.cancelBubble = true; event.cancelBubble = true;
}); });
node.addEventListener('canExecute', function(event) { node.addEventListener('canExecute', function(event) {
if (event.command.id === commandId) if (event.command.id !== commandId)
event.canExecute = document.queryCommandEnabled(event.command.id); return;
event.canExecute = document.queryCommandEnabled(event.command.id);
event.command.setHidden(false);
}); });
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment