email quick create

This commit is contained in:
yuri
2016-03-30 11:19:46 +03:00
parent d3bcadce13
commit 13dc6f0d76
2 changed files with 14 additions and 7 deletions
@@ -17,6 +17,7 @@
"detail": "views/email/modals/detail",
"compose": "views/modals/compose-email"
},
"quickCreateModalType": "compose",
"menu": {
"list": {
"buttons": [
+13 -7
View File
@@ -58,13 +58,7 @@ Espo.define('views/site/navbar', 'view', function (Dep) {
'click a[data-action="quick-create"]': function (e) {
e.preventDefault();
var scope = $(e.currentTarget).data('name');
this.notify('Loading...');
this.createView('quickCreate', 'views/modals/edit', {scope: scope}, function (view) {
view.once('after:render', function () {
this.notify(false);
});
view.render();
});
this.quickCreate(scope);
},
'click .navbar-header a.minimizer': function () {
var $body = $('body');
@@ -379,6 +373,18 @@ Espo.define('views/site/navbar', 'view', function (Dep) {
});
}
return menuDefs;
},
quickCreate: function (scope) {
Espo.Ui.notify(this.translate('Loading...'));
var type = this.getMetadata().get(['clientDefs', scope, 'quickCreateModalType']) || 'edit';
var viewName = this.getMetadata().get(['clientDefs', scope, 'modalViews', type]) || 'views/modals/edit';
this.createView('quickCreate', viewName , {scope: scope}, function (view) {
view.once('after:render', function () {
Espo.Ui.notify(false);
});
view.render();
});
}
});