summaryrefslogtreecommitdiffstats
path: root/module/web/static
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-12 21:31:01 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-12 21:31:01 +0100
commitcea91a96def3fbdee0f7778efff5af77b72dd2b4 (patch)
treec07402903dfcfe65db1c3c7c35a656deb734ad80 /module/web/static
parentadded animation for packages (diff)
downloadpyload-cea91a96def3fbdee0f7778efff5af77b72dd2b4.tar.xz
animate package added
Diffstat (limited to 'module/web/static')
-rw-r--r--module/web/static/js/views/packageTreeView.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/module/web/static/js/views/packageTreeView.js b/module/web/static/js/views/packageTreeView.js
index 7491a285e..8791a93f2 100644
--- a/module/web/static/js/views/packageTreeView.js
+++ b/module/web/static/js/views/packageTreeView.js
@@ -34,8 +34,8 @@ define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection', 'vie
this.tree.fetch({success: function() {
self.render();
self.tree.get('packages').on('add', function(pack) {
- console.log('Package ' + pack.get('pid') +' added to tree');
- self.appendPackage(pack);
+ console.log('Package ' + pack.get('pid') + ' added to tree');
+ self.appendPackage(pack, 0, true);
})
}});
@@ -65,11 +65,20 @@ define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection', 'vie
},
// TODO sorting ?!
- // Append a package to the list
- appendPackage: function(pack) {
- this.packageUL.append(new packageView({model: pack}).render().el);
+ // Append a package to the list, index, animate it
+ appendPackage: function(pack, i, animation) {
+ var el = new packageView({model: pack}).render().el;
+ if (animation == true)
+ $(el).hide();
+
+ this.packageUL.append(el);
+
+ if (animation == true)
+ $(el).fadeIn();
},
+
+ // TODO: remove this debug stuff
toggle: false,
filter: function(e) {