diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-09-16 21:45:10 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-09-16 21:45:10 +0200 |
commit | 6a8303b004e1976739371431aa7358c672ad7313 (patch) | |
tree | 108da54419661af1cd6edc860ec6494be61e7051 /module/web/static/js/views/packageView.js | |
parent | higher low speed time, easier way to set curl options (diff) | |
download | pyload-6a8303b004e1976739371431aa7358c672ad7313.tar.xz |
added bootstrap
Diffstat (limited to 'module/web/static/js/views/packageView.js')
-rw-r--r-- | module/web/static/js/views/packageView.js | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/module/web/static/js/views/packageView.js b/module/web/static/js/views/packageView.js index b820b9ba8..171325d1f 100644 --- a/module/web/static/js/views/packageView.js +++ b/module/web/static/js/views/packageView.js @@ -1,5 +1,5 @@ -define(['jquery', 'backbone', 'underscore', 'views/fileView', 'views/modal/modalView'], - function($, Backbone, _, fileView, modalView) { +define(['jquery', 'backbone', 'underscore', 'views/fileView', 'utils/lazyRequire'], + function($, Backbone, _, fileView, lazyLoader) { // Renders a single package item return Backbone.View.extend({ @@ -8,10 +8,11 @@ define(['jquery', 'backbone', 'underscore', 'views/fileView', 'views/modal/modal events: { 'click .load': 'load', 'click .delete': 'delete', - 'click .show': 'show' + 'click .show-dialog': 'show' }, modal: null, + requireOnce: lazyLoader.once(), initialize: function() { this.model.on('change', this.render, this); @@ -22,7 +23,7 @@ define(['jquery', 'backbone', 'underscore', 'views/fileView', 'views/modal/modal this.$el.html('Package ' + this.model.get('pid') + ': ' + this.model.get('name')); this.$el.append($('<a class="load" href="#"> Load</a>')); this.$el.append($('<a class="delete" href="#"> Delete</a>')); - this.$el.append($('<a class="show" href="#"> Show</a>')); + this.$el.append($('<a class="show-dialog" href="#"> Show</a>')); if (this.model.isLoaded()) { var ul = $('<ul></ul>'); @@ -47,11 +48,13 @@ define(['jquery', 'backbone', 'underscore', 'views/fileView', 'views/modal/modal }, show: function() { - if (this.modal === null) - this.modal = new modalView(); - - this.modal.show(); - } - + var self = this; + this.requireOnce(['views/modal/modalView'], function(modalView){ + if (self.modal === null) + self.modal = new modalView(); + + self.modal.show(); + }); + } }); });
\ No newline at end of file |