summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/views/abstract/itemView.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-23 21:04:47 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-23 21:04:47 +0200
commitf370ef06ad9db2e47edba02b99271137324997cf (patch)
treed432ea10ee77fc9a4165c685eefe9afd1714fcbf /module/web/static/js/views/abstract/itemView.js
parentfixed the dashboard (diff)
downloadpyload-f370ef06ad9db2e47edba02b99271137324997cf.tar.xz
added some animations, code for show/hiding items
Diffstat (limited to 'module/web/static/js/views/abstract/itemView.js')
-rw-r--r--module/web/static/js/views/abstract/itemView.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/module/web/static/js/views/abstract/itemView.js b/module/web/static/js/views/abstract/itemView.js
new file mode 100644
index 000000000..993764d3e
--- /dev/null
+++ b/module/web/static/js/views/abstract/itemView.js
@@ -0,0 +1,36 @@
+define(['jquery', 'backbone', 'underscore'], function($, Backbone, _) {
+
+ // A view that is meant for temporary displaying
+ // All events must be unbound in onDestroy
+ return Backbone.View.extend({
+
+ tagName: 'li',
+ destroy: function() {
+ this.undelegateEvents();
+ this.unbind();
+ if (this.onDestroy){
+ this.onDestroy();
+ }
+ this.$el.removeData().unbind();
+ this.remove();
+ },
+
+
+ hide: function() {
+ this.$el.zapOut();
+ },
+
+ show: function() {
+ this.$el.zapIn();
+ },
+
+ load: function() {
+ this.model.fetch();
+ },
+
+ delete: function() {
+ this.model.destroy();
+ }
+
+ });
+}); \ No newline at end of file