diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-08-30 10:25:09 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-08-30 10:25:09 +0200 |
commit | 4508a121881d5aef31479a96a11cab4783ac48ee (patch) | |
tree | d7fadfbaf2f41bdcb9bd316b3328ba2f7ac24ec4 /core | |
parent | 4da9a15b32f6dfe862f7d481e018f978f50bf55c (diff) | |
download | nextcloud-server-4508a121881d5aef31479a96a11cab4783ac48ee.tar.gz nextcloud-server-4508a121881d5aef31479a96a11cab4783ac48ee.zip |
Prevent default action from being executed when the button is disabled
When "enter" is pressed in the file picker a "click" event is triggered
on the primary action button. However, in some cases, like when the file
picker is in "Choose" mode and the current directory in the file picker
is the root folder, the primary action button is disabled. In those
cases pressing enter should not trigger a click action on the button and
be ignored instead.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/js/jquery.ocdialog.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index f3a54119e78..02bd3069c59 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -64,7 +64,7 @@ self.$buttonrow.find($(event.target)).length === 0 ) { var $button = self.$buttonrow.find('button.primary'); - if($button) { + if($button && !$button.prop('disabled')) { $button.trigger('click'); } } else if(self.$buttonrow) { |