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)
committerSam Hemelryk <sam@moodle.com>
Tue, 10 Jul 2012 00:24:08 +0000 (12:24 +1200)
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') {