Skip to content

Commit

Permalink
ui, tokenizer2, another round at opnsense/plugins#769
Browse files Browse the repository at this point in the history
(cherry picked from commit 6e759fb)
  • Loading branch information
AdSchellevis authored and fichtner committed Aug 9, 2018
1 parent c1206e0 commit a2e359e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/opnsense/www/js/opnsense_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,17 @@ function formatTokenizersUI() {
// unbind change event while loading initial content
sender.unbind('tokenize:tokens:change');

// selected items
var items = [];
sender.find('option:selected').each(function () {
items.push([$(this).val(), $(this).text()]);
});

// re-init tokenizer items
var items = $(this).val();
sender.tokenize2().trigger('tokenize:clear');
$.each(items, function(key, item){
sender.tokenize2().trigger('tokenize:tokens:add', item);
});
for (i=0 ; i < items.length ; ++i) {
sender.tokenize2().trigger('tokenize:tokens:add', items[i]);
}
sender.tokenize2().trigger('tokenize:select');
sender.tokenize2().trigger('tokenize:dropdown:hide');
}
Expand Down

0 comments on commit a2e359e

Please sign in to comment.