amd require usage change

This commit is contained in:
Yuri Kuznetsov
2022-06-12 21:37:42 +03:00
parent 3c2b7a757c
commit 58b9b5a775
24 changed files with 50 additions and 51 deletions
+1 -1
View File
@@ -377,7 +377,7 @@ define('router', [], function () {
* Navigate.
*
* @param {string} fragment An URL fragment.
* @param {Options} options Options: trigger, replace.
* @param {Object} options Options: trigger, replace.
*/
navigate: function (fragment, options) {
this.history.push(fragment);
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/about', 'view', function (Dep) {
define('views/about', ['view'], function (Dep) {
return Dep.extend({
+1 -2
View File
@@ -26,9 +26,8 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/base', 'view', function (Dep) {
define('views/base', ['view'], function (Dep) {
return Dep.extend({
});
});
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/clear-cache', 'view', function (Dep) {
define('views/clear-cache', ['view'], function (Dep) {
return Dep.extend({
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/collapsed-modal-bar', 'view', function (Dep) {
define('views/collapsed-modal-bar', ['view'], function (Dep) {
return Dep.extend({
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/collapsed-modal', 'view', function (Dep) {
define('views/collapsed-modal', ['view'], function (Dep) {
return Dep.extend({
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/dashlet', 'view', function (Dep) {
define('views/dashlet', ['view'], function (Dep) {
return Dep.extend({
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/deleted-detail', 'views/detail', function (Dep) {
define('views/deleted-detail', ['views/detail'], function (Dep) {
return Dep.extend({
+1 -2
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/detail', 'views/main', function (Dep) {
define('views/detail', ['views/main'], function (Dep) {
return Dep.extend({
@@ -460,6 +460,5 @@ define('views/detail', 'views/main', function (Dep) {
this.getRouter().navigate(url, {trigger: false});
});
},
});
});
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/edit', 'views/main', function (Dep) {
define('views/edit', ['views/main'], function (Dep) {
return Dep.extend({
+23 -19
View File
@@ -26,12 +26,13 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/fields/base', 'view', function (Dep) {
define('views/fields/base', ['view'], function (Dep) {
/**
* A base field view. Can be in different modes. Each mode uses a separate template.
*
* @todo Document all options.
* @todo Document events.
*
* @class Espo.Views.Fields.Base
* @extends Espo.View
@@ -40,43 +41,43 @@ define('views/fields/base', 'view', function (Dep) {
/**
* A field type.
* @property {string}
* @type {string}
*/
type: 'base',
/**
* List mode template.
* @property {string}
* @type {string}
*/
listTemplate: 'fields/base/list',
/**
* List-link mode template.
* @property {string}
* @type {string}
*/
listLinkTemplate: 'fields/base/list-link',
/**
* Detail mode template.
* @property {string}
* @type {string}
*/
detailTemplate: 'fields/base/detail',
/**
* Edit mode template.
* @property {string}
* @type {string}
*/
editTemplate: 'fields/base/edit',
/**
* Search mode template.
* @property {string}
* @type {string}
*/
searchTemplate: 'fields/base/search',
/**
* A validation list. There should be a validate{Name} method for each item.
* @property {Array.<string>}
* A validation list. There should be a `validate{Name}` method for each item.
* @type {Array.<string>}
*/
validations: ['required'],
@@ -92,27 +93,30 @@ define('views/fields/base', 'view', function (Dep) {
/**
* A field name.
* @property {string}
* @type {string}
*/
name: null,
/**
* @type {Object}
*/
defs: null,
/**
* Field params.
* @property {Object}
* @type {Object}
*/
params: null,
/**
* A mode.
* @property {string}
* @type {string}
*/
mode: null,
/**
* Search params.
* @property {?Object}
* @type {?Object}
*/
searchParams: null,
@@ -120,19 +124,19 @@ define('views/fields/base', 'view', function (Dep) {
/**
* Inline edit disabled.
* @property {boolean}
* @type {boolean}
*/
inlineEditDisabled: false,
/**
* Field is disabled.
* @property {boolean}
* @type {boolean}
*/
disabled: false,
/**
* Field is read-only.
* @property {boolean}
* @type {boolean}
*/
readOnly: false,
@@ -140,7 +144,7 @@ define('views/fields/base', 'view', function (Dep) {
/**
* Attribute values before edit.
* @property {Object}
* @type {Object}
*/
initialAttributes: null,
@@ -150,7 +154,7 @@ define('views/fields/base', 'view', function (Dep) {
/**
* A record helper.
* @property {Espo.ViewRecordHelper}
* @type {Espo.ViewRecordHelper}
*/
recordHelper: null,
@@ -166,7 +170,7 @@ define('views/fields/base', 'view', function (Dep) {
/**
* Get cell element. Works only after rendered.
*
* @retrun {$}
* @returns {$}
*/
getCellElement: function () {
return this.$el.parent();
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/header', 'view', function (Dep) {
define('views/header', ['view'], function (Dep) {
return Dep.extend({
+2 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/home', 'view', function (Dep) {
define('views/home', ['view'], function (Dep) {
return Dep.extend({
@@ -34,6 +34,7 @@ define('views/home', 'view', function (Dep) {
setup: function () {
var view = this.getMetadata().get(['clientDefs', 'Home', 'view']) || 'views/dashboard';
this.createView('content', view, {
el: this.options.el + ' > .home-content'
});
+3 -3
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/list-tree', 'views/list', function (Dep) {
define('views/list-tree', ['views/list'], function (Dep) {
return Dep.extend({
@@ -37,8 +37,8 @@ define('views/list-tree', 'views/list', function (Dep) {
name: 'listTree',
getRecordViewName: function () {
return this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.listTree') || 'views/record/list-tree';
return this.getMetadata()
.get('clientDefs.' + this.scope + '.recordViews.listTree') || 'views/record/list-tree';
},
});
});
+3 -2
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/list-with-categories', 'views/list', function (Dep) {
define('views/list-with-categories', ['views/list'], function (Dep) {
return Dep.extend({
@@ -390,7 +390,8 @@ define('views/list-with-categories', 'views/list', function (Dep) {
this.nestedCategoriesCollection.parentId = this.currentCategoryId;
this.nestedCategoriesCollection.currentCategoryId = this.currentCategoryId;
this.nestedCategoriesCollection.currentCategoryName = this.currentCategoryName || this.currentCategoryId;
this.nestedCategoriesCollection.currentCategoryName = this.currentCategoryName ||
this.currentCategoryId;
this.nestedCategoriesCollection.where = [filter];
},
-1
View File
@@ -517,6 +517,5 @@ define('views/list', ['views/main', 'search-manager'], function (Dep, SearchMana
isActualForReuse: function () {
return this.collection.isFetched;
},
});
});
+1 -3
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/login-second-step', 'view', function (Dep) {
define('views/login-second-step', ['view'], function (Dep) {
return Dep.extend({
@@ -42,8 +42,6 @@ define('views/login-second-step', 'view', function (Dep) {
events: {
'submit #login-form': function (e) {
this.send();
return;
},
'click [data-action="backToLogin"]': function () {
this.trigger('back');
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/login', 'view', function (Dep) {
define('views/login', ['view'], function (Dep) {
return Dep.extend({
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/main', 'view', function (Dep) {
define('views/main', ['view'], function (Dep) {
return Dep.extend({
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/merge', 'views/main', function (Dep) {
define('views/merge', ['views/main'], function (Dep) {
return Dep.extend({
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/modal', 'view', function (Dep) {
define('views/modal', ['view'], function (Dep) {
return Dep.extend({
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/popup-notification', 'view', function (Dep) {
define('views/popup-notification', ['view'], function (Dep) {
return Dep.extend({
+1 -1
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/record/edit', 'views/record/detail', function (Dep) {
define('views/record/edit', ['views/record/detail'], function (Dep) {
return Dep.extend({
+1 -3
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/stream', 'view', function (Dep) {
define('views/stream', ['view'], function (Dep) {
return Dep.extend({
@@ -161,7 +161,5 @@ define('views/stream', 'view', function (Dep) {
this.collection.offset = 0;
this.collection.maxSize = this.getConfig().get('recordsPerPage') || this.collection.maxSize;
},
});
});