2017-02-20 02:42:12 +08:00
|
|
|
(function(window, $) {
|
|
|
|
$(function() {
|
2019-07-31 05:10:07 +08:00
|
|
|
function replaceGroup() {
|
|
|
|
$('li[data-inputosaurus][title*=","]').each(function (index, elem) {
|
|
|
|
var $elem = $(elem)
|
2019-07-31 18:31:36 +08:00
|
|
|
var title = $elem.attr('title')
|
2019-07-31 05:10:07 +08:00
|
|
|
var cut = title.indexOf('<')
|
|
|
|
title = title.substr(cut + 1, title.length - cut - 2)
|
|
|
|
$elem.parents('ul').find('.ui-autocomplete-input').val(title)
|
|
|
|
$('.ui-autocomplete-input').trigger('blur')
|
|
|
|
})
|
2017-02-20 02:42:12 +08:00
|
|
|
setTimeout(function () {
|
2019-07-31 05:10:07 +08:00
|
|
|
$('li[data-inputosaurus][title*=","]').find('a').trigger('click')
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
$('body').on('click', '.ui-autocomplete a', function () {
|
|
|
|
replaceGroup()
|
|
|
|
})
|
2017-02-20 02:42:12 +08:00
|
|
|
|
2019-07-31 05:10:07 +08:00
|
|
|
$(document).on('keydown', function (e) {
|
|
|
|
if (e.which === 13) {
|
|
|
|
setTimeout(function () {
|
|
|
|
replaceGroup()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}(window, $))
|