You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2014/04/18 02:24:58 UTC

git commit: CB-6470: fixed filter to work with new objs returned by searcher view

Repository: cordova-registry-web
Updated Branches:
  refs/heads/master e32261638 -> 00caf0456


CB-6470: fixed filter to work with new objs returned by searcher view


Project: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/commit/00caf045
Tree: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/tree/00caf045
Diff: http://git-wip-us.apache.org/repos/asf/cordova-registry-web/diff/00caf045

Branch: refs/heads/master
Commit: 00caf0456c47b9cd598c5f89a5eb03edd05e53f9
Parents: e322616
Author: Steven Gill <st...@gmail.com>
Authored: Thu Apr 17 17:24:47 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Thu Apr 17 17:24:47 2014 -0700

----------------------------------------------------------------------
 attachments/js/filters/platformFilter.js | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-registry-web/blob/00caf045/attachments/js/filters/platformFilter.js
----------------------------------------------------------------------
diff --git a/attachments/js/filters/platformFilter.js b/attachments/js/filters/platformFilter.js
index 492fa03..b9315fa 100644
--- a/attachments/js/filters/platformFilter.js
+++ b/attachments/js/filters/platformFilter.js
@@ -3,8 +3,6 @@ angular.module('registry').filter('platformFilter', function () {
         if(platformFilters == null || platformFilters.length == 0) {
             return items;//short circuit, if no filter, return original list.
         }
-        console.log(items);
-        console.log(platformFilters);
         var newItems = [];
 
         // "firefoxos"
@@ -20,21 +18,21 @@ angular.module('registry').filter('platformFilter', function () {
         for(var i = 0, j = items.length -1; i < j; i++) {
 
             var item = items[i];
-            if(!item.value || !item.value.versions)
+            if(!item.value || !item.value.version)
                 continue;//cant do anything & we dont want in list if it doenst exist, right?
 
-            var latestVersion = item.value.versions[item.value['dist-tags'].latest];
+            var latestVersion = item.value.version;
 
             if(!latestVersion)
                 continue; //no latest version, what can you do?
 
-            if(!latestVersion.platforms)
+            if(!item.value.platforms)
                 continue;
 
             var platformCount = 0;
 
             for(platform in platformFilters) {
-                if(latestVersion.platforms.indexOf(platformFilters[platform]) != -1)
+                if(item.value.platforms.indexOf(platformFilters[platform]) != -1)
                     platformCount++;
             }
             if(platformCount <= 0)
@@ -47,4 +45,4 @@ angular.module('registry').filter('platformFilter', function () {
 
         return newItems;
     };
-});
\ No newline at end of file
+});