From 4e80fa931dc47addc5768ce97a65ee6fbbca5366 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 27 Feb 2018 10:18:45 +0000 Subject: [PATCH] ui: remap manually instead of flushing for #1689 --- src/opnsense/www/js/opnsense_ui.js | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/opnsense/www/js/opnsense_ui.js b/src/opnsense/www/js/opnsense_ui.js index edf421821..487bc4e9f 100644 --- a/src/opnsense/www/js/opnsense_ui.js +++ b/src/opnsense/www/js/opnsense_ui.js @@ -156,31 +156,22 @@ function updateServiceStatusUI(status) { /** * reformat all tokenizers on this document */ -function formatTokenizersUI(){ - // remove old tokenizers (if any) - $('div[class="tokenize Tokenize"]').each(function(){ - $(this).remove(); - }); - $('select[class="tokenize"]').each(function(){ +function formatTokenizersUI() { + $('select[class="tokenize"]').each(function () { if ($(this).prop("size")==0) { maxDropdownHeight=String(36*5)+"px"; // default number of items - } else { number_of_items = $(this).prop("size"); maxDropdownHeight=String(36*number_of_items)+"px"; } - hint=$(this).data("hint"); width=$(this).data("width"); - allownew=$(this).data("allownew"); - nbDropdownElements=$(this).data("nbdropdownelements"); maxTokenContainerHeight=$(this).data("maxheight"); - $(this).tokenize({ - displayDropdownOnFocus: true, - newElements: allownew, - nbDropdownElements: nbDropdownElements, - placeholder:hint - }); + $tokenizer = $(this).tokenize(); + $tokenizer.resizeSearchInput(); + $tokenizer.remap(true); + $tokenizer.updatePlaceholder(); + $(this).parent().find('ul[class="TokensContainer"]').parent().css("width",width); $(this).parent().find('ul[class="Dropdown"]').css("max-height", maxDropdownHeight); if ( maxDropdownHeight != undefined ) {