diff --git a/build/changelog/entries/2015/03/10197.SUP-573.bugfix b/build/changelog/entries/2015/03/10197.SUP-573.bugfix new file mode 100644 index 0000000000..3f50227e61 --- /dev/null +++ b/build/changelog/entries/2015/03/10197.SUP-573.bugfix @@ -0,0 +1,3 @@ +When using ENTER to submit a search in the repository browser, the ENTER +possible bubbled to the page and caused something to happen there as well. +Bubbling of the ENTER from the search field is now prevented. diff --git a/src/lib/vendor/repository-browser/js/repository-browser-unminified.js b/src/lib/vendor/repository-browser/js/repository-browser-unminified.js index f9aaf81e59..6bd1b43375 100644 --- a/src/lib/vendor/repository-browser/js/repository-browser-unminified.js +++ b/src/lib/vendor/repository-browser/js/repository-browser-unminified.js @@ -328,6 +328,7 @@ var $search = $title.find('.repository-browser-search-field').keypress(function (event) { // ENTER ←┘ if (13 === event.keyCode) { + event.preventDefault(); browser._triggerSearch(); } }); diff --git a/src/lib/vendor/repository-browser/js/repository-browser.js b/src/lib/vendor/repository-browser/js/repository-browser.js index c8af931de1..6859ac9270 100644 --- a/src/lib/vendor/repository-browser/js/repository-browser.js +++ b/src/lib/vendor/repository-browser/js/repository-browser.js @@ -3,7 +3,7 @@ a.onselectstart=null;d(".repository-browser-modal-overlay").hide()}function v(a) a._i18n("Repository Browser")+""),f=d('
');b.append(e,f);f.height(c-e.outerHeight(!0));f.bind("loaded.jstree",function(){d(this).find(">ul>li:first").css("padding-top",5);d(this).find('li[rel="repository"]:first').each(function(a,b){f.jstree("open_node",b)})});f.bind("select_node.jstree",function(b,c){c.args[0].context||a.treeNodeSelected(c.rslt.obj)});f.bind("open_node.jstree",function(b,c){a.folderOpened(c.rslt.obj)});f.bind("close_node.jstree",function(b, c){a.folderClosed(c.rslt.obj)});f.jstree({types:a.types,rootFolderId:a.rootFolderId,plugins:["themes","json_data","ui","types"],core:{animation:250},ui:{select_limit:1},themes:{theme:"browser",url:a.rootPath+"css/jstree.css",dots:!0,icons:!0},json_data:{correct_state:!0,data:function(b,c){a.manager?(a.jstree_callback=c,a._fetchSubnodes.call(a,b,c)):c()}}});return f}function x(a,b){var c=d('
'); b.append(c);return c}function y(a,b){var c=b.find(".ui-jqgrid-titlebar"),e='
'+a._i18n("Close")+'
';c.addClass("repository-browser-grab-handle").append(e);c.find(".repository-browser-search-btn").click(function(){a._triggerSearch()}); -var f=c.find(".repository-browser-search-field").keypress(function(b){13===b.keyCode&&a._triggerSearch()});f.val(a._i18n("Input search text...")).addClass("repository-browser-search-field-empty");f.focus(function(){f.val()===a._i18n("Input search text...")&&f.val("").removeClass("repository-browser-search-field-empty")});f.blur(function(){""===f.val()&&f.val(a._i18n("Input search text...")).addClass("repository-browser-search-field-empty")});c.find(".repository-browser-close-btn").click(function(){a.close()}); +var f=c.find(".repository-browser-search-field").keypress(function(b){13===b.keyCode&&(b.preventDefault(),a._triggerSearch())});f.val(a._i18n("Input search text...")).addClass("repository-browser-search-field-empty");f.focus(function(){f.val()===a._i18n("Input search text...")&&f.val("").removeClass("repository-browser-search-field-empty")});f.blur(function(){""===f.val()&&f.val(a._i18n("Input search text...")).addClass("repository-browser-search-field-empty")});c.find(".repository-browser-close-btn").click(function(){a.close()}); c.find(".repository-browser-btn").mousedown(function(){d(this).addClass("repository-browser-pressed")}).mouseup(function(){d(this).removeClass("repository-browser-pressed")});return c}function z(a,b,c){var e=d('
'),f=[""],g=[{name:"id",sorttype:"int",firstsortorder:"asc",hidden:!0}];d.each(a.columns,function(a,b){f.push(b.title||" ");g.push({name:a,width:b.width,sortable:b.sortable,sorttype:b.sorttype,resizable:b.resizable,fixed:b.fixed})}); var h="repository-browser-list-page-"+ ++m;b.append(e,'
');e.jqGrid({datatype:"local",width:b.width(),shrinkToFit:!0,colNames:f,colModel:g,caption:" ",altRows:!0,altclass:"repository-browser-list-altrow",resizeclass:"repository-browser-list-resizable",pager:h,viewrecords:!0,onPaging:function(){},loadError:function(){},ondblClickRow:function(){},gridComplete:function(){},loadComplete:function(){}});b.find(".ui-jqgrid-bdiv").height(c- (b.find(".ui-jqgrid-titlebar").height()+b.find(".ui-jqgrid-hdiv").height()+b.find(".ui-jqgrid-pager").height()));e.click(function(){a.rowClicked.apply(a,arguments)});b.find(".ui-pg-button").unbind().find(">span.ui-icon").each(function(){var b=d(this).parent(),c=this.className.match(/ui\-icon\-seek\-([a-z]+)/)[1];a._pagingBtns[c]=b;b.addClass("ui-state-disabled").click(function(){d(this).hasClass("ui-state-disabled")||a._doPaging(c)})});b.find(".ui-pg-input").parent().hide();b.find(".ui-separator").parent().css("opacity",