diff options
Diffstat (limited to 'module/web/static/js/views/abstract')
-rw-r--r-- | module/web/static/js/views/abstract/itemView.js | 46 | ||||
-rw-r--r-- | module/web/static/js/views/abstract/modalView.js | 124 |
2 files changed, 0 insertions, 170 deletions
diff --git a/module/web/static/js/views/abstract/itemView.js b/module/web/static/js/views/abstract/itemView.js deleted file mode 100644 index 394044ec4..000000000 --- a/module/web/static/js/views/abstract/itemView.js +++ /dev/null @@ -1,46 +0,0 @@ -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.slideUp(); - }, - - show: function() { - this.$el.slideDown(); - }, - - unrender: function() { - var self = this; - this.$el.slideUp(function() { - self.destroy(); - }); - }, - - deleteItem: function(e) { - if (e) - e.stopPropagation(); - this.model.destroy(); - }, - - restart: function(e) { - if(e) - e.stopPropagation(); - this.model.restart(); - } - - }); -});
\ No newline at end of file diff --git a/module/web/static/js/views/abstract/modalView.js b/module/web/static/js/views/abstract/modalView.js deleted file mode 100644 index 170681f06..000000000 --- a/module/web/static/js/views/abstract/modalView.js +++ /dev/null @@ -1,124 +0,0 @@ -define(['jquery', 'backbone', 'underscore', 'omniwindow'], function($, Backbone, _) { - - return Backbone.View.extend({ - - events: { - 'click .btn-confirm': 'confirm', - 'click .btn-close': 'hide', - 'click .close': 'hide' - }, - - template: null, - dialog: null, - - onHideDestroy: false, - confirmCallback: null, - - initialize: function(template, confirm) { - this.confirmCallback = confirm; - var self = this; - if (this.template === null) { - if (template) { - this.template = template; - // When template was provided this is a temporary dialog - this.onHideDestroy = true; - } - else - require(['text!tpl/default/modal.html'], function(template) { - self.template = template; - }); - } - - }, - - // TODO: whole modal stuff is not very elegant - render: function() { - this.$el.html(this.template(this.renderContent())); - this.onRender(); - - if (this.dialog === null) { - this.$el.addClass('modal hide'); - this.$el.css({opacity: 0, scale: 0.7}); - - var self = this; - $("body").append(this.el); - this.dialog = this.$el.omniWindow({ - overlay: { - selector: '#modal-overlay', - hideClass: 'hide', - animations: { - hide: function(subjects, internalCallback) { - subjects.overlay.transition({opacity: 'hide', delay: 100}, 300, function() { - internalCallback(subjects); - self.onHide(); - if (self.onHideDestroy) - self.destroy(); - }); - }, - show: function(subjects, internalCallback) { - subjects.overlay.fadeIn(300); - internalCallback(subjects); - }}}, - modal: { - hideClass: 'hide', - animations: { - hide: function(subjects, internalCallback) { - subjects.modal.transition({opacity: 'hide', scale: 0.7}, 300); - internalCallback(subjects); - }, - - show: function(subjects, internalCallback) { - subjects.modal.transition({opacity: 'show', scale: 1, delay: 100}, 300, function() { - internalCallback(subjects); - }); - }} - }}); - } - - return this; - }, - - onRender: function() { - - }, - - renderContent: function() { - return {}; - }, - - show: function() { - if (this.dialog === null) - this.render(); - - this.dialog.trigger('show'); - - this.onShow(); - }, - - onShow: function() { - - }, - - hide: function() { - this.dialog.trigger('hide'); - }, - - onHide: function() { - - }, - - confirm: function() { - if (this.confirmCallback) - this.confirmCallback.apply(); - - this.hide(); - }, - - destroy: function() { - this.$el.remove(); - this.dialog = null; - this.remove(); - } - - }); -});
\ No newline at end of file |