Another vi modeline.
[profile/ivi/cowhide.git] / examples / hoofbeats / javascripts / library.js
index 494a0b5..6a5d570 100644 (file)
@@ -22,11 +22,10 @@ $(function() {
                 "type", "EXACTLY", "VIDEO");
             this.typeFilter = new tizen.CompositeFilter(
                 "UNION", [this.audioTypeFilter, this.videoTypeFilter]);
-
-            this.sortMode = new tizen.SortMode("trackNumber", "ASC");
         };
 
         this.scan = function() {
+            this.deferred = new $.Deferred();
             this.initialize()
 
             this.mediaItems = [];
@@ -37,13 +36,16 @@ $(function() {
                 this.errorCB.bind(this),
                 null,
                 this.typeFilter,
-                this.sortMode,
+                null,
                 this.fetchCount,
                 this.fetchOffset);
+
+            return this.deferred.promise();
         };
 
         this.errorCB = function(error) {
             console.log("Error: " + error.name);
+            this.deferred.reject();
             throw new Error(error.name);
         };
 
@@ -65,9 +67,11 @@ $(function() {
                     this.errorCB.bind(this),
                     null,
                     this.typeFilter,
-                    this.sortMode,
+                    null,
                     this.fetchCount,
                     this.fetchOffset);
+            } else {
+                self.deferred.resolve();
             }
         };
     };