diff --git a/repository/filepicker.js b/repository/filepicker.js index 190572d9d7c..cc3bd0a9846 100644 --- a/repository/filepicker.js +++ b/repository/filepicker.js @@ -282,7 +282,7 @@ M.core_filepicker.init = function(Y, options) { } }, this, node); y_title.on('click', function(e, p){ - //Y.Event.simulate(y_file, 'click'); + y_file.simulate('click'); }, this, node); } else { var fileinfo = {}; @@ -318,7 +318,8 @@ M.core_filepicker.init = function(Y, options) { path.setStyle('display', 'none'); } var panel = Y.one('#panel-'+client_id); - var html = '
'; html += '
'; @@ -369,7 +370,7 @@ M.core_filepicker.init = function(Y, options) { repository_id: repository_id, 'params': params, callback: function(id, obj, args) { - if (scope.options.editor_target&&scope.options.env=='editor') { + if (scope.options.editor_target && scope.options.env=='editor') { scope.options.editor_target.value=obj.url; scope.options.editor_target.onchange(); } @@ -385,6 +386,13 @@ M.core_filepicker.init = function(Y, options) { } }, true); }, this); + var elform = Y.one('#'+form_id); + elform.on('keydown', function(e) { + if (e.keyCode == 13) { + getfile.simulate('click'); + e.preventDefault(); + } + }, this); var cancel = Y.one('#fp-cancel-'+client_id); cancel.on('click', function(e) { this.view_files(); @@ -701,6 +709,20 @@ M.core_filepicker.init = function(Y, options) { active_filepicker = this; }, this); } + var elform = Y.one('#'+form_id); + elform.on('keydown', function(e) { + if (e.keyCode == 13) { + switch (action) { + case 'search': + search_button.simulate('click'); + break; + default: + login_button.simulate('click'); + break; + } + e.preventDefault(); + } + }, this); }, search: function(args) {