summaryrefslogtreecommitdiffstats
path: root/module/web/static/js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-01 20:43:19 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-01 20:43:19 +0100
commit1e24b46986edd019a8c600033370fa2559a00657 (patch)
tree50f5644922478acb8d33e0965350f87b6c880869 /module/web/static/js
parentgenerate js_apitypes, updated lodash, working type filters on webui (diff)
downloadpyload-1e24b46986edd019a8c600033370fa2559a00657.tar.xz
animated filtering, removed background from fileView
Diffstat (limited to 'module/web/static/js')
-rw-r--r--module/web/static/js/views/fileView.js11
-rw-r--r--module/web/static/js/views/filterView.js8
-rw-r--r--module/web/static/js/views/linkGrabberModal.js3
3 files changed, 16 insertions, 6 deletions
diff --git a/module/web/static/js/views/fileView.js b/module/web/static/js/views/fileView.js
index f4f228559..32ce7d723 100644
--- a/module/web/static/js/views/fileView.js
+++ b/module/web/static/js/views/fileView.js
@@ -14,6 +14,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'views/abstract/itemView'],
initialize: function() {
this.listenTo(this.model, 'change', this.render);
+ // This will be triggered manually and changed before with silent=true
this.listenTo(this.model, 'change:visible', this.visibility_changed);
this.listenTo(this.model, 'remove', this.destroy);
},
@@ -63,8 +64,14 @@ define(['jquery', 'backbone', 'underscore', 'app', 'views/abstract/itemView'],
App.vent.trigger('file:selection');
},
- visibility_changed: function() {
-
+ visibility_changed: function(visible) {
+ // TODO: improve animation
+ if (visible)
+ this.$el.slideOut();
+ else {
+ this.$el.calculateHeight(true);
+ this.$el.slideIn();
+ }
}
});
diff --git a/module/web/static/js/views/filterView.js b/module/web/static/js/views/filterView.js
index eef5db92f..2c2aecf0b 100644
--- a/module/web/static/js/views/filterView.js
+++ b/module/web/static/js/views/filterView.js
@@ -66,8 +66,10 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'],
var self = this;
App.dashboard.files.map(function(file) {
var visible = file.get('visible');
- if (visible !== self.is_visible(file))
- file.set('visible', !visible);
+ if (visible !== self.is_visible(file)) {
+ file.set('visible', !visible, {silent: true});
+ file.trigger('change:visible', !visible);
+ }
});
},
@@ -78,7 +80,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'],
if (this.state == Api.DownloadState.Finished)
return _.indexOf(Finished, file.get('download').status) > -1;
else if (this.state == Api.DownloadState.Unfinished)
- return _.indexOf(Finished, file.get('download').status) > -1 && _.indexOf(Failed, file.get('download').status) > -1;
+ return _.indexOf(Finished, file.get('download').status) == -1 && _.indexOf(Failed, file.get('download').status) == -1;
else if (this.state == Api.DownloadState.Failed)
return _.indexOf(Failed, file.get('download').status) > -1;
diff --git a/module/web/static/js/views/linkGrabberModal.js b/module/web/static/js/views/linkGrabberModal.js
index 13900f222..abc92d4e0 100644
--- a/module/web/static/js/views/linkGrabberModal.js
+++ b/module/web/static/js/views/linkGrabberModal.js
@@ -30,7 +30,8 @@ define(['jquery', 'underscore', 'app', 'views/abstract/modalView', 'text!tpl/def
type: 'POST',
data: {
name: JSON.stringify($('#inputPackageName').val()),
- links: JSON.stringify(['http://download.pyload.org/random.bin', 'invalid link'])
+ links: JSON.stringify(['http://download.pyload.org/random.bin', 'invalid link', 'invalid link 2', 'invalid link 3', 'inavlid link 4',
+ 'http://download.pyload.org/random.bin', 'http://download.pyload.org/random.bin', 'http://download.pyload.org/random.bin'])
},
success: function() {
App.vent.trigger('package:added');