Commit dbee2e6a authored by Marc Egger's avatar Marc Egger

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 || {};
}
});
// window.qfqChange = false;
// when the hidden input field changes, overwrite value with tag object list
tagApi.bind('tm:hiddenUpdate', function (e, tags) {
var tagObjects = $.map(tags, function (t) {
......@@ -138,21 +136,21 @@ var QfqNS = QfqNS || {};
// if value of hidden field is changed externally, update tagManager
$element.on('qfqChange', function () {
// window.qfqChange = true;
tagApi.tagsManager('disableHiddenUpdate', true);
existingTags = $element.val() !== '' ? JSON.parse($element.val()) : [];
tagApi.tagsManager('empty');
$.each(existingTags, function (i, tag) {
existingTags = $element.val() !== '' ? JSON.parse($element.val()) : [];
tagApi.tagsManager('empty');
$.each(existingTags, function (i, tag) {
tagApi.tagsManager('pushTag', tag.value);
});
// window.qfqChange = false;
tagApi.tagsManager('disableHiddenUpdate', false);
});
tagApi.tagsManager('disableHiddenUpdate', false);
});
// add existing tags
tagApi.tagsManager('disableHiddenUpdate', true);
$.each(existingTags, function (i, tag) {
tagApi.tagsManager('pushTag', tag.value);
});
tagApi.tagsManager('disableHiddenUpdate', false);
// add typahead
$inputField.typeahead({
......
Markdown is supported
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