From e58851c50fd5c69ea6cdf32ff21e7cc98b70a872 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 29 Mar 2016 15:49:33 +0000 Subject: [PATCH] Mobile theme W.I.P: - Fix view destroy and close eg. used in mail view -> delete --- mail/js/app.js | 13 +++++-------- phpgwapi/js/jsapi/app_base.js | 3 +-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 5a26ef723e..d0cdd39bf4 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -311,10 +311,7 @@ app.classes.mail = AppJS.extend( // we need to set mail_currentlyFocused var otherwise mail // defined actions won't work this.mail_currentlyFocussed = this.et2.mail_currentlyFocussed; - // a replacement for is_popup to distinguishe whether - // the view should be considered like popup and it does indicate - // we are in view mode - this.mail_viewMode = true; + } }, @@ -1585,9 +1582,9 @@ app.classes.mail = AppJS.extend( { egw(window).close(); } - else if (this.mail_viewMode) + else if (typeof this.et2_view!='undefined' && typeof this.et2_view.close == 'function') { - this.close(); + this.et2_view.close(); } }, @@ -2091,7 +2088,7 @@ app.classes.mail = AppJS.extend( data = { msg: [this.et2.getArrayMgr("content").getEntry('mail_id')] || '', all: _allMessagesChecked || false, - popup: this.mail_viewMode || egw(window).is_popup() || false, + popup: typeof this.et2_view!='undefined' || egw(window).is_popup() || false, activeFilters: _action.id == 'readall'? false : this.mail_getActiveFilters(_action) }, rowClass = _action.id; @@ -2115,7 +2112,7 @@ app.classes.mail = AppJS.extend( rowClass = 'seen'; if (data.popup) { - var et_2 = this.mail_viewMode? etemplate2:opener.etemplate2; + var et_2 = typeof this.et2_view!='undefined'? etemplate2:opener.etemplate2; tree = et_2.getByApplication('mail')[0].widgetContainer.getWidgetById(this.nm_index+'[foldertree]'); } else diff --git a/phpgwapi/js/jsapi/app_base.js b/phpgwapi/js/jsapi/app_base.js index a12661463c..6606220e83 100644 --- a/phpgwapi/js/jsapi/app_base.js +++ b/phpgwapi/js/jsapi/app_base.js @@ -418,7 +418,6 @@ var AppJS = (function(){ "use strict"; return Class.extend( delete self.viewTemplate; delete self.viewContainer; delete self.et2_view; - this.destroy(app); // we need to reference back into parent context this for (var v in self) { @@ -482,7 +481,7 @@ var AppJS = (function(){ "use strict"; return Class.extend( // define a global close function for view template // in order to be able to destroy view on action - app[this.appname]['close'] = destroy; + this.et2_view.close = destroy; }, /**