From: Christoph Wurst Date: Tue, 7 May 2019 18:06:11 +0000 (+0200) Subject: Remove unused singleselect script X-Git-Tag: v17.0.0beta1~465^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F15426%2Fhead;p=nextcloud-server.git Remove unused singleselect script Signed-off-by: Christoph Wurst --- diff --git a/core/js/singleselect.js b/core/js/singleselect.js deleted file mode 100644 index 94f7da82640..00000000000 --- a/core/js/singleselect.js +++ /dev/null @@ -1,95 +0,0 @@ -(function ($) { - $.fn.singleSelect = function () { - return this.each(function (i, select) { - var input = $(''), - gravity = $(select).attr('data-tipsy-gravity'), - inputTooltip = $(select).attr('data-inputtitle'); - if (inputTooltip){ - input.attr('title', inputTooltip); - } - if (typeof gravity === 'undefined') { - gravity = 'n'; - } - select = $(select); - input.css('position', 'absolute'); - input.css({ - 'box-sizing': 'border-box', - '-moz-box-sizing': 'border-box', - 'margin': 0, - 'width': (select.width() - 5) + 'px', - 'height': (select.outerHeight() - 2) + 'px', - 'border': 'none', - 'box-shadow': 'none', - 'margin-top': '1px', - 'margin-left': '1px', - 'z-index': 1000 - }); - input.hide(); - $('body').append(input); - - select.on('change', function (event) { - var value = $(this).val(), - newAttr = $('option:selected', $(this)).attr('data-new'); - if (!(typeof newAttr !== 'undefined' && newAttr !== false)) { - input.hide(); - select.data('previous', value); - } else { - event.stopImmediatePropagation(); - // adjust offset, in case the user scrolled - input.css(select.offset()); - input.show(); - if ($.fn.tipsy){ - input.tipsy({gravity: gravity, trigger: 'manual'}); - input.tipsy('show'); - } - input.focus(); - } - }); - - $(select).data('previous', $(select).val()); - - input.on('change', function () { - var value = $(this).val(); - if (value) { - select.children().attr('selected', null); - var existingOption = select.children().filter(function (i, option) { - return ($(option).val() == value); - }); - if (existingOption.length) { - existingOption.attr('selected', 'selected'); - } else { - var option = $('