diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-07 20:06:11 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-07 20:06:11 +0200 |
commit | 533f83104bc7b053cd75efad8b5123f6130360a0 (patch) | |
tree | e2e8d3e6498461cbe31d8d987e431db820cb1bd3 | |
parent | 5893f218c247d4c0829fb74161e663f3903e15ad (diff) | |
download | nextcloud-server-533f83104bc7b053cd75efad8b5123f6130360a0.tar.gz nextcloud-server-533f83104bc7b053cd75efad8b5123f6130360a0.zip |
Remove unused singleselect script
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r-- | core/js/singleselect.js | 95 |
1 files changed, 0 insertions, 95 deletions
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 = $('<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 = $('<option/>'); - option.attr('selected', 'selected').attr('value', value).text(value); - select.children().last().before(option); - } - select.val(value); - select.css('background-color', null); - input.val(null); - input.hide(); - select.change(); - } else { - var previous = select.data('previous'); - select.children().attr('selected', null); - select.children().each(function (i, option) { - if ($(option).val() == previous) { - $(option).attr('selected', 'selected'); - } - }); - select.removeClass('active'); - input.hide(); - } - }); - - input.on('blur', function () { - $(this).change(); - if ($.fn.tipsy){ - $(this).tipsy('hide'); - } - }); - input.click(function(ev) { - // prevent clicks to close any container - ev.stopPropagation(); - }); - }); - }; -})(jQuery); |