|
|
|
@ -3144,9 +3144,6 @@ function rcube_elastic_ui()
|
|
|
|
|
function recipient_input(obj)
|
|
|
|
|
{
|
|
|
|
|
var list, input, selection = '',
|
|
|
|
|
input_len_update = function() {
|
|
|
|
|
input.css('width', Math.max(5, input.val().length * 15 + 10));
|
|
|
|
|
},
|
|
|
|
|
apply_func = function() {
|
|
|
|
|
// update the original input
|
|
|
|
|
$(obj).val(list.text() + input.val());
|
|
|
|
@ -3192,7 +3189,6 @@ function rcube_elastic_ui()
|
|
|
|
|
|
|
|
|
|
input.val(result.text);
|
|
|
|
|
apply_func();
|
|
|
|
|
input_len_update();
|
|
|
|
|
|
|
|
|
|
return result.recipients.length > 0;
|
|
|
|
|
},
|
|
|
|
@ -3234,20 +3230,17 @@ function rcube_elastic_ui()
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
input_len_update();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Create the input element and "editable" area
|
|
|
|
|
input = $('<input>').attr({type: 'text', tabindex: $(obj).attr('tabindex')})
|
|
|
|
|
.on('paste change', parse_func)
|
|
|
|
|
.on('input', input_len_update) // only to fix input length after paste
|
|
|
|
|
.on('keydown', keydown_func)
|
|
|
|
|
.on('blur', function() { list.removeClass('focus'); })
|
|
|
|
|
.on('focus mousedown', function() { list.addClass('focus'); });
|
|
|
|
|
|
|
|
|
|
list = $('<ul>').addClass('form-control recipient-input ac-input rounded-left')
|
|
|
|
|
.append($('<li>').append(input))
|
|
|
|
|
.append($('<li class="input">').append(input))
|
|
|
|
|
// "selection" hack to allow text selection in the recipient box or multiple boxes (#7129)
|
|
|
|
|
.on('mouseup', function () { selection = window.getSelection().toString(); })
|
|
|
|
|
.on('click', function() { if (!selection.length) input.focus(); })
|
|
|
|
|