From 1f4c6cd6e4b712263b40de4ce1fcebe716019b4f Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 6 Dec 2013 18:15:24 +0100 Subject: package edit dialog --- pyload/web/app/scripts/views/abstract/modalView.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'pyload/web/app/scripts/views/abstract/modalView.js') diff --git a/pyload/web/app/scripts/views/abstract/modalView.js b/pyload/web/app/scripts/views/abstract/modalView.js index 61016a9fb..2fd84441b 100644 --- a/pyload/web/app/scripts/views/abstract/modalView.js +++ b/pyload/web/app/scripts/views/abstract/modalView.js @@ -31,6 +31,11 @@ define(['jquery', 'backbone', 'underscore', 'omniwindow'], function($, Backbone, } }, + // Class method that will show a temporary instance + display: function() { + + }, + // TODO: whole modal stuff is not very elegant render: function() { this.$el.html(this.template(this.renderContent())); @@ -110,8 +115,14 @@ define(['jquery', 'backbone', 'underscore', 'omniwindow'], function($, Backbone, }, confirm: function() { - if (this.confirmCallback) - this.confirmCallback.apply(); + // Call the confirms given or from extended class + if (this.confirmCallback) { + if (this.confirmCallback.apply() === false) + return; + } else if (_.isFunction(this.constructor.prototype.confirmCallback)) { + if (this.constructor.prototype.confirmCallback.call(this) === false) + return; + } this.hide(); }, -- cgit v1.2.3