global search changes

This commit is contained in:
yuri
2016-06-02 12:39:06 +03:00
parent d5c93f21b5
commit c90cdc62fb
4 changed files with 19 additions and 19 deletions
@@ -63,7 +63,7 @@ Espo.define('views/global-search/global-search', 'view', function (Dep) {
runSearch: function (text) {
var text = this.$input.val().trim();
if (text != '' && text.length > 2) {
if (text != '' && text.length >= 2) {
text = text;
this.search(text);
}
@@ -82,7 +82,7 @@ Espo.define('views/global-search/global-search', 'view', function (Dep) {
$container.appendTo(this.$el.find('.global-search-panel-container'));
this.createView('panel', 'GlobalSearch.Panel', {
this.createView('panel', 'views/global-search/panel', {
el: '#global-search-panel',
collection: this.collection,
}, function (view) {
+6 -6
View File
@@ -24,14 +24,14 @@
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
************************************************************************/
Espo.define('Views.GlobalSearch.NameField', 'Views.Fields.Base', function (Dep) {
Espo.define('views/global-search/name-field', 'views/fields/base', function (Dep) {
return Dep.extend({
listTemplate: 'global-search.name-field',
listTemplate: 'global-search/name-field',
data: function () {
return {
scope: this.model.get('_scope'),
@@ -41,6 +41,6 @@ Espo.define('Views.GlobalSearch.NameField', 'Views.Fields.Base', function (Dep)
},
});
});
+5 -5
View File
@@ -26,16 +26,16 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('Views.GlobalSearch.Panel', 'View', function (Dep) {
Espo.define('views/global-search/panel', 'view', function (Dep) {
return Dep.extend({
template: 'global-search.panel',
template: 'global-search/panel',
afterRender: function () {
this.listenToOnce(this.collection, 'sync', function () {
this.createView('list', 'Record.ListExpanded', {
this.createView('list', 'views/record/list-expanded', {
el: this.options.el + ' .list-container',
collection: this.collection,
listLayout: {
@@ -43,7 +43,7 @@ Espo.define('Views.GlobalSearch.Panel', 'View', function (Dep) {
[
{
name: 'name',
view: 'GlobalSearch.NameField',
view: 'views/global-search/name-field',
params: {
containerEl: this.options.el
},
@@ -52,7 +52,7 @@ Espo.define('Views.GlobalSearch.Panel', 'View', function (Dep) {
],
right: {
name: 'read',
view: 'GlobalSearch.ScopeBadge',
view: 'views/global-search/scope-badge',
width: '80px'
}
}
@@ -24,14 +24,14 @@
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
************************************************************************/
Espo.define('Views.GlobalSearch.ScopeBadge', 'View', function (Dep) {
Espo.define('views/global-search/scope-badge', 'view', function (Dep) {
return Dep.extend({
template: 'global-search.scope-badge',
template: 'global-search/scope-badge',
data: function () {
return {
label: this.translate(this.model.get('_scope'), 'scopeNames')
@@ -39,6 +39,6 @@ Espo.define('Views.GlobalSearch.ScopeBadge', 'View', function (Dep) {
},
});
});