mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-01 12:38:30 +08:00
Fix edit tag on task page
This commit is contained in:
parent
665c178d79
commit
ef241150f6
2 changed files with 11 additions and 1 deletions
|
@ -100,7 +100,17 @@ function bindEditTagsAjax() {
|
|||
});
|
||||
manageTagsModalBody.find('.edit-tag-form')
|
||||
.on('ajax:success', function(e, data) {
|
||||
var newTag;
|
||||
initTagsModalBody(data);
|
||||
dropdownSelector.removeValue('#module-tags-selector', this.dataset.tagId, '', true);
|
||||
newTag = $('#manage-module-tags-modal .list-group-item[data-tag-id=' + this.dataset.tagId + ']');
|
||||
dropdownSelector.addValue('#module-tags-selector', {
|
||||
value: newTag.data('tag-id'),
|
||||
label: newTag.data('name'),
|
||||
params: {
|
||||
color: newTag.data('color')
|
||||
}
|
||||
}, true);
|
||||
})
|
||||
.on('ajax:error', function(e, data) {
|
||||
$(this).renderFormErrors('tag', data.responseJSON);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
</div>
|
||||
|
||||
<div class="row tag-edit" style="display: none;">
|
||||
<%= bootstrap_form_for tag, remote: true, url: project_tag_path(@my_module.experiment.project, tag, format: :json), method: :put, html: { class: "edit-tag-form" } do |f| %>
|
||||
<%= bootstrap_form_for tag, remote: true, url: project_tag_path(@my_module.experiment.project, tag, format: :json), method: :put, html: { class: "edit-tag-form" }, data: {tag_id: tag.id} do |f| %>
|
||||
<%= hidden_field_tag :my_module_id, @my_module.id %>
|
||||
<div class="col-xs-7">
|
||||
<%= f.text_field :name, hide_label: true %>
|
||||
|
|
Loading…
Reference in a new issue