Skip to content

Commit

Permalink
Merge branch 'MDL-43827-master' of git://github.com/mihailges/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Dec 25, 2017
2 parents 9993c1d + f44f9db commit d048e94
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/form/filemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ M.form_filemanager.init = function(Y, options) {
},
setup_select_file: function() {
var selectnode = this.selectnode;
var scope = this;
// bind labels with corresponding inputs
selectnode.all('.fp-saveas,.fp-path,.fp-author,.fp-license').each(function (node) {
node.all('label').set('for', node.one('input,select').generateID());
Expand All @@ -798,12 +799,10 @@ M.form_filemanager.init = function(Y, options) {
e.preventDefault();
this.update_file();
}, this);
selectnode.all('form').on('keydown', function(e) {
if (e.keyCode == 13) {
e.preventDefault();
this.update_file();
}
}, this);
selectnode.all('form input').on('key', function(e) {
e.preventDefault();
scope.update_file();
}, 'enter');
selectnode.one('.fp-file-download').on('click', function(e) {
e.preventDefault();
if (this.selectui.fileinfo.type != 'folder') {
Expand Down Expand Up @@ -922,6 +921,11 @@ M.form_filemanager.init = function(Y, options) {
// TODO if changed asked to confirm, the same with close button
this.selectui.hide();
}, this);
selectnode.all('.fp-file-update, .fp-file-download, .fp-file-delete, .fp-file-zip, .fp-file-unzip, ' +
'.fp-file-setmain, .fp-file-cancel').on('key', function(e) {
e.preventDefault();
this.simulate('click');
}, 'enter');
},
get_parent_folder_name: function(node) {
if (node.type != 'folder' || node.filepath.length < node.fullname.length+1) {
Expand Down

0 comments on commit d048e94

Please sign in to comment.