From c2bbc2e61e142ebc8628deead4d1164bb64776a2 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 4 Mar 2015 09:52:31 +0200 Subject: [PATCH] showModal action --- frontend/client/src/views/main.js | 35 +++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/frontend/client/src/views/main.js b/frontend/client/src/views/main.js index c177b18068..8e652844dd 100644 --- a/frontend/client/src/views/main.js +++ b/frontend/client/src/views/main.js @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. - ************************************************************************/ + ************************************************************************/ Espo.define('Views.Main', 'View', function (Dep) { @@ -71,24 +71,33 @@ Espo.define('Views.Main', 'View', function (Dep) { } }, this); }, this); - - /*var defaultMenu = this.getMetadata().get('clientDefs.' + scope + '.menu.default') || {}; - types.forEach(function (type) { - if (defaultMenu[type]) { - if (!items[type]) { - items[type] = []; - } - defaultMenu[type].forEach(function (i) { - items[type].push(i); - }); - } - }.bind(this));*/ } return menu; }, getHeader: function () {}, + + actionShowModal: function (data) { + var view = data.view; + if (!view) { + return; + }; + this.createView('modal', view, { + model: this.model, + collection: this.collection + }, function (view) { + view.render(); + this.listenTo(view, 'after:save', function () { + if (this.model) { + this.model.fetch(); + } + if (this.collection) { + this.collection.fetch(); + } + }, this); + }.bind(this)); + } }); });