MDL-34139 filemanager select-file dialogue should update file on Enter
authorMarina Glancy <marina@moodle.com>
Mon, 2 Jul 2012 07:12:17 +0000 (15:12 +0800)
committerMarina Glancy <marina@moodle.com>
Fri, 6 Jul 2012 01:44:16 +0000 (09:44 +0800)
lib/form/filemanager.js

index d81d5d9..164c683 100644 (file)
@@ -736,6 +736,12 @@ 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.one('.fp-file-download').on('click', function(e) {
                 e.preventDefault();
                 if (this.selectui.fileinfo.type != 'folder') {