summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/views
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/static/js/views')
-rw-r--r--module/web/static/js/views/abstract/itemView.js8
-rw-r--r--module/web/static/js/views/packageTreeView.js2
-rw-r--r--module/web/static/js/views/packageView.js8
3 files changed, 13 insertions, 5 deletions
diff --git a/module/web/static/js/views/abstract/itemView.js b/module/web/static/js/views/abstract/itemView.js
index 993764d3e..a8cb14e7d 100644
--- a/module/web/static/js/views/abstract/itemView.js
+++ b/module/web/static/js/views/abstract/itemView.js
@@ -24,11 +24,15 @@ define(['jquery', 'backbone', 'underscore'], function($, Backbone, _) {
this.$el.zapIn();
},
- load: function() {
+ load: function(e) {
+ if(e)
+ e.stopPropagation();
this.model.fetch();
},
- delete: function() {
+ delete: function(e) {
+ if(e)
+ e.stopPropagation();
this.model.destroy();
}
diff --git a/module/web/static/js/views/packageTreeView.js b/module/web/static/js/views/packageTreeView.js
index f746bf0a3..516c2f5d1 100644
--- a/module/web/static/js/views/packageTreeView.js
+++ b/module/web/static/js/views/packageTreeView.js
@@ -64,7 +64,7 @@ define(['jquery', 'backbone', 'underscore', 'models/TreeCollection', 'views/pack
type: 'POST',
data: {
name: JSON.stringify($('#name').val()),
- links: JSON.stringify(['http://download.pyload.org/random.bin'])
+ links: JSON.stringify(['http://download.pyload.org/random.bin', 'invalid link'])
},
success: function() {
self.tree.fetch({success: function() {
diff --git a/module/web/static/js/views/packageView.js b/module/web/static/js/views/packageView.js
index 6a7e3cc65..a0de18827 100644
--- a/module/web/static/js/views/packageView.js
+++ b/module/web/static/js/views/packageView.js
@@ -8,7 +8,7 @@ define(['jquery', 'views/abstract/itemView', 'underscore', 'views/fileView', 'ut
className: 'package-view',
template: _.template($("#template-package").html()),
events: {
- 'click .load': 'load',
+ 'click .package-header': 'load',
'click .delete': 'delete',
'click .show-dialog': 'show_dialog'
},
@@ -28,6 +28,8 @@ define(['jquery', 'views/abstract/itemView', 'underscore', 'views/fileView', 'ut
},
render: function() {
+
+ // TODO: on expanding don't re-render
this.$el.html(this.template(this.model.toJSON()));
var data = [
@@ -54,7 +56,9 @@ define(['jquery', 'views/abstract/itemView', 'underscore', 'views/fileView', 'ut
});
},
- show_dialog: function() {
+ show_dialog: function(e) {
+ console.log(e);
+ e.stopPropagation();
var self = this;
this.requireOnce(['views/modal/modalView'], function(modalView){
if (self.modal === null)