Skip to content
Snippets Groups Projects
Commit 5d58b555 authored by Jeremy Kersten's avatar Jeremy Kersten Committed by Olivier Dony
Browse files

[FIX] website_forum: use other attr than value to init select2

The backend would otherwise fail because the value has been already processed
parent ad1ca233
No related branches found
No related tags found
No related merge requests found
......@@ -171,7 +171,7 @@
// Take default tags from the input value
initSelection: function (element, callback) {
var data = [];
_.each(JSON.parse(element.val()), function(x) {
_.each(element.data('init-value'), function(x) {
data.push({ id: x.id, text: x.name, isNew: false });
});
element.val('');
......@@ -179,7 +179,6 @@
},
});
//TODO Remove in master
if($('input.load_tags').length){
var tags = $("input.load_tags").val();
$("input.load_tags").val("");
......
......@@ -376,7 +376,7 @@
<div t-if="not is_answer">
<br/>
<input type="hidden" name="tag_type" value="select2"/>
<input type="hidden" name="question_tag" class="form-control col-md-9 js_select2" placeholder="Tags" t-attf-value="#{tags}"/>
<input type="hidden" name="question_tag" class="form-control col-md-9 js_select2" placeholder="Tags" value="see data init value" t-attf-data-init-value="#{tags}"/>
<br/>
</div>
<button class="btn btn-primary btn-lg">Save</button>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment