From 18a32a9c6564c10eca1c51857b41b93d39fe8aec Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 18 Oct 2012 12:17:25 +0000 Subject: [PATCH] possibility to reuse selector with this util method git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1399604 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-webapp-js/src/main/webapp/js/archiva/main.js | 2 +- .../archiva-webapp-js/src/main/webapp/js/archiva/search.js | 7 ++++--- .../archiva-webapp-js/src/main/webapp/js/archiva/utils.js | 7 ++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js index 72eb6b69d..c61b018a9 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js @@ -536,7 +536,7 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa ko.applyBindings({artifacts:artifacts,gridViewModel:gridViewModel},dependeesContentDiv.get(0)); }, complete: function(){ - removeMediumSpinnerImg(("#artifact-details-used-by-content")); + removeMediumSpinnerImg(dependeesContentDiv); } }); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js index 8c0a96cf0..297c74e96 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js @@ -1859,10 +1859,11 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno } this.search=function(url,repositoriesIds){ - var searchResultsGrid=mainContent.find("#search-results #search-results-grid" ); + var searchResultsGrid=mainContent.find("#search-results" ).find("#search-results-grid" ); mainContent.find("#btn-basic-search" ).button("loading"); mainContent.find("#btn-advanced-search" ).button("loading"); - $("#user-messages").html(mediumSpinnerImg()); + var userMessages=$("#user-messages"); + userMessages.html(mediumSpinnerImg()); if (repositoriesIds){ self.selectedRepoIds=repositoriesIds; } else { @@ -1911,7 +1912,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno complete:function() { mainContent.find("#btn-basic-search" ).button("reset"); mainContent.find("#btn-advanced-search" ).button("reset"); - removeMediumSpinnerImg("#user-messages"); + removeMediumSpinnerImg(userMessages); } } ); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js index 7d8e02445..9c0bcfc3f 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js @@ -206,7 +206,12 @@ require(["jquery","jquery.tmpl","i18n","knockout"], function(jquery,jqueryTmpl,i } removeMediumSpinnerImg=function(selector){ - $(selector ).find("#medium-spinner").remove(); + if (typeof selector == 'string') { + $(selector).find("#medium-spinner").remove(); + } else { + selector.find("#medium-spinner").remove(); + } + } mediumSpinnerImg=function(){