]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1573] start work on browse screen
authorOlivier Lamy <olamy@apache.org>
Thu, 16 Feb 2012 21:27:48 +0000 (21:27 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 16 Feb 2012 21:27:48 +0000 (21:27 +0000)
use slide effect to magnify browsing :-)

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1245188 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js

index 748dd9a0d3384401b239af6286a70ecdbda72615..2dcb48a8b4637540d8673b476ff6692f25fb9824 100644 (file)
@@ -21,23 +21,31 @@ $(function() {
   BrowseTopViewModel=function(groupIds){
     this.groupIds=groupIds;
     var mainContent = $("#main-content");
-    mainContent.find("#browse_result").html(mediumSpinnerImg());
+    var browseResult=mainContent.find("#browse_result");
     displayGroupDetail=function(groupId){
       $.log("groupId:"+groupId);
-      $.ajax("restServices/archivaServices/browseService/browseGroupId/"+encodeURIComponent(groupId), {
-          type: "GET",
-          dataType: 'json',
-          success: function(data) {
-            var browseGroupIdEntryies = $.isArray(data.browseGroupIdResult.browseGroupIdEntries) ?
-                $.map(data.browseGroupIdResult.browseGroupIdEntries,function(item){
-                  return new BrowseGroupIdEntry(item.name, item.project);
-                }): [data.browseGroupIdResult.browseGroupIdEntries];
-            mainContent.find("#browse_result").html($("#browse-groups-div-tmpl" ).tmpl());
-            var browseGroupsViewModel = new BrowseGroupsViewModel(browseGroupIdEntryies);
 
-            ko.applyBindings(browseGroupsViewModel,mainContent.find("#browse-groups-div" ).get(0));
-          }
-      });
+      browseResult.hide( "slide", {}, 700,
+        function(){
+          browseResult.html(mediumSpinnerImg());
+          browseResult.show();
+          $.ajax("restServices/archivaServices/browseService/browseGroupId/"+encodeURIComponent(groupId), {
+            type: "GET",
+            dataType: 'json',
+            success: function(data) {
+              var browseGroupIdEntryies = $.isArray(data.browseGroupIdResult.browseGroupIdEntries) ?
+                   $.map(data.browseGroupIdResult.browseGroupIdEntries,function(item){
+                     return new BrowseGroupIdEntry(item.name, item.project);
+                   }): [data.browseGroupIdResult.browseGroupIdEntries];
+              browseResult.html($("#browse-groups-div-tmpl" ).tmpl());
+              var browseGroupsViewModel = new BrowseGroupsViewModel(browseGroupIdEntryies);
+
+              ko.applyBindings(browseGroupsViewModel,mainContent.find("#browse-groups-div" ).get(0));
+            }
+         });
+        }
+      );
+
     }
   }