1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 10:50:24 +00:00

[select2] upgraded it to v4.0

This commit is contained in:
llj
2018-07-26 18:28:17 +08:00
parent d9fbe44381
commit 62c3519e85
35 changed files with 428 additions and 4568 deletions

View File

@@ -58,20 +58,18 @@ define([
_this = this;
$form.modal();
$('#simplemodal-container').css({'height':'auto'});
$('#simplemodal-container').css({'width':'auto', 'height':'auto'});
$('[name="group_owner"]', $form).select2($.extend(
Common.contactInputOptionsForSelect2(), {
width: '268px',
containerCss: {'margin-bottom': '5px'},
maximumSelectionSize: 1,
placeholder: gettext("Search user or enter email and press Enter"), // to override 'placeholder' returned by `Common.conta...`
formatSelectionTooBig: gettext("You cannot select any more choices")
width: '100%',
maximumSelectionLength: 1,
placeholder: gettext("Search user or enter email and press Enter")
}));
$form.on('submit', function() {
var group_name = $.trim($('[name="group_name"]', $form).val());
var group_owner = $.trim($('[name="group_owner"]', $form).val());
var group_owner = $('[name="group_owner"]', $form).val();
var $error = $('.error', $form);
var $submitBtn = $('[type="submit"]', $form);
@@ -83,7 +81,10 @@ define([
$error.hide();
Common.disableButton($submitBtn);
groups.create({'group_name': group_name, 'group_owner': group_owner}, {
groups.create({
'group_name': group_name,
'group_owner': group_owner[0]
}, {
prepend: true,
wait: true,
success: function() {