Commit dbee2e6a authored by Marc Egger's avatar Marc Egger
Browse files

refs #10117 solve dirty at start bug and clean up

parent 44896163
Pipeline #3285 passed with stages
in 3 minutes and 46 seconds
...@@ -126,8 +126,6 @@ var QfqNS = QfqNS || {}; ...@@ -126,8 +126,6 @@ var QfqNS = QfqNS || {};
} }
}); });
// window.qfqChange = false;
// when the hidden input field changes, overwrite value with tag object list // when the hidden input field changes, overwrite value with tag object list
tagApi.bind('tm:hiddenUpdate', function (e, tags) { tagApi.bind('tm:hiddenUpdate', function (e, tags) {
var tagObjects = $.map(tags, function (t) { var tagObjects = $.map(tags, function (t) {
...@@ -138,21 +136,21 @@ var QfqNS = QfqNS || {}; ...@@ -138,21 +136,21 @@ var QfqNS = QfqNS || {};
// if value of hidden field is changed externally, update tagManager // if value of hidden field is changed externally, update tagManager
$element.on('qfqChange', function () { $element.on('qfqChange', function () {
// window.qfqChange = true;
tagApi.tagsManager('disableHiddenUpdate', true); tagApi.tagsManager('disableHiddenUpdate', true);
existingTags = $element.val() !== '' ? JSON.parse($element.val()) : []; existingTags = $element.val() !== '' ? JSON.parse($element.val()) : [];
tagApi.tagsManager('empty'); tagApi.tagsManager('empty');
$.each(existingTags, function (i, tag) { $.each(existingTags, function (i, tag) {
tagApi.tagsManager('pushTag', tag.value); tagApi.tagsManager('pushTag', tag.value);
}); });
// window.qfqChange = false; tagApi.tagsManager('disableHiddenUpdate', false);
tagApi.tagsManager('disableHiddenUpdate', false);
}); });
// add existing tags // add existing tags
tagApi.tagsManager('disableHiddenUpdate', true);
$.each(existingTags, function (i, tag) { $.each(existingTags, function (i, tag) {
tagApi.tagsManager('pushTag', tag.value); tagApi.tagsManager('pushTag', tag.value);
}); });
tagApi.tagsManager('disableHiddenUpdate', false);
// add typahead // add typahead
$inputField.typeahead({ $inputField.typeahead({
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment