1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +00:00

Revert "[select2] upgraded it to v4.0"

This reverts commit 62c3519e85.
This commit is contained in:
lian
2018-08-03 16:08:29 +08:00
parent 20cb4ce86f
commit ee8e4135ea
35 changed files with 4567 additions and 428 deletions

View File

@@ -36,16 +36,18 @@ define([
$('[name="email"]', $form).select2($.extend(
Common.contactInputOptionsForSelect2(), {
width: '280px'
width: '275px',
containerCss: {'margin-bottom': '5px'},
placeholder: gettext("Search users or enter emails and press Enter")
}));
$form.on('submit', function() {
var group_id = _this.groupMemberCollection.group_id;
var emails = $('[name="email"]', $form).val();
var emails = $.trim($('[name="email"]', $form).val());
var $error = $('.error', $form);
var $submitBtn = $('[type="submit"]', $form);
if (!emails.length) {
if (!emails) {
$error.html(gettext("It is required.")).show();
return false;
}
@@ -62,7 +64,7 @@ define([
dataType: 'json',
beforeSend: Common.prepareCSRFToken,
traditional: true,
data: {'email': emails},
data: {'email': emails.split(',')},
success: function(data) {
if (data.success.length > 0) {
_this.groupMemberCollection.add(data.success, {prepend: true});