mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
['search user'] select2: enable 'directly enter email'
* the separator is 'Enter', i.e., clicking the Enter key
This commit is contained in:
@@ -841,8 +841,6 @@ function userInputOPtionsForSelect2(user_search_url) {
|
|||||||
return {
|
return {
|
||||||
tags: [],
|
tags: [],
|
||||||
|
|
||||||
tokenSeparators: [",", " "],
|
|
||||||
|
|
||||||
minimumInputLength: 1, // input at least 1 character
|
minimumInputLength: 1, // input at least 1 character
|
||||||
|
|
||||||
ajax: {
|
ajax: {
|
||||||
@@ -886,6 +884,13 @@ function userInputOPtionsForSelect2(user_search_url) {
|
|||||||
formatSelection: function(item) {
|
formatSelection: function(item) {
|
||||||
return HTMLescape(item.name || item.id); // if no name, show the email, i.e., when directly input, show the email
|
return HTMLescape(item.name || item.id); // if no name, show the email, i.e., when directly input, show the email
|
||||||
},
|
},
|
||||||
|
|
||||||
|
createSearchChoice: function(term) {
|
||||||
|
return {
|
||||||
|
'id': $.trim(term)
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
escapeMarkup: function(m) { return m; }
|
escapeMarkup: function(m) { return m; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -538,8 +538,6 @@ define([
|
|||||||
// tags need `<input type="hidden" />`, not `<select>`
|
// tags need `<input type="hidden" />`, not `<select>`
|
||||||
tags: [],
|
tags: [],
|
||||||
|
|
||||||
tokenSeparators: [",", " "],
|
|
||||||
|
|
||||||
minimumInputLength: 1, // input at least 1 character
|
minimumInputLength: 1, // input at least 1 character
|
||||||
|
|
||||||
formatInputTooShort: gettext("Please enter 1 or more character"),
|
formatInputTooShort: gettext("Please enter 1 or more character"),
|
||||||
@@ -590,6 +588,13 @@ define([
|
|||||||
formatSelection: function(item) {
|
formatSelection: function(item) {
|
||||||
return _this.HTMLescape(item.name || item.id); // if no name, show the email, i.e., when directly input, show the email
|
return _this.HTMLescape(item.name || item.id); // if no name, show the email, i.e., when directly input, show the email
|
||||||
},
|
},
|
||||||
|
|
||||||
|
createSearchChoice: function(term) {
|
||||||
|
return {
|
||||||
|
'id': $.trim(term)
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
escapeMarkup: function(m) { return m; }
|
escapeMarkup: function(m) { return m; }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user