diff options
author | 2013-03-24 15:51:30 +0100 | |
---|---|---|
committer | 2013-03-24 15:51:30 +0100 | |
commit | 7ca154e613329050885b7c6a799488475266218e (patch) | |
tree | 6da18e4565766aee6a3f47f23dd0dfc396fec78e /module/web/static/js/views/notificationView.js | |
parent | implemented interactions for multi user, show waiting queries on webui (diff) | |
download | pyload-7ca154e613329050885b7c6a799488475266218e.tar.xz |
enter captchas on webui
Diffstat (limited to 'module/web/static/js/views/notificationView.js')
-rw-r--r-- | module/web/static/js/views/notificationView.js | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/module/web/static/js/views/notificationView.js b/module/web/static/js/views/notificationView.js index 22c727304..afb542eed 100644 --- a/module/web/static/js/views/notificationView.js +++ b/module/web/static/js/views/notificationView.js @@ -1,5 +1,5 @@ define(['jquery', 'backbone', 'underscore', 'app', 'collections/InteractionList'], - function($, Backbone, _, App, InteractionList) { + function($, Backbone, _, App, InteractionList, queryModal) { // Renders context actions for selection packages and files return Backbone.View.extend({ @@ -12,10 +12,10 @@ define(['jquery', 'backbone', 'underscore', 'app', 'collections/InteractionList' }, tasks: null, - // current open task - current: null, // area is slided out visible: false, + // the dialog + modal: null, initialize: function() { this.tasks = new InteractionList(); @@ -40,7 +40,10 @@ define(['jquery', 'backbone', 'underscore', 'app', 'collections/InteractionList' }, render: function() { - this.$el.html(this.template(this.tasks.toJSON())); + + // only render when it will be visible + if (this.tasks.length > 0) + this.$el.html(this.template(this.tasks.toJSON())); if (this.tasks.length > 0 && !this.visible) { this.$el.slideOut(); @@ -55,6 +58,18 @@ define(['jquery', 'backbone', 'underscore', 'app', 'collections/InteractionList' }, openQuery: function() { + var self = this; + + _.requireOnce(['views/queryModal'], function(modalView) { + if (self.modal === null) { + self.modal = new modalView(); + self.modal.parent = self; + } + + self.modal.model = self.tasks.at(0); + self.modal.render(); + self.modal.show(); + }); }, |