mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 04:47:22 +08:00
Merge pull request #7632 from artoscinote/ma_SCI_10687
Fix reloading of tags on canvas [SCI-10687]
This commit is contained in:
commit
bbc5b777df
2 changed files with 17 additions and 7 deletions
|
@ -8,8 +8,8 @@ const app = createApp({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
myModuleParams: null,
|
myModuleParams: null,
|
||||||
|
myModuleUrl: null,
|
||||||
tagsModalOpen: false,
|
tagsModalOpen: false,
|
||||||
tagsUrl: null
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -20,6 +20,7 @@ const app = createApp({
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open(myModuleUrl) {
|
open(myModuleUrl) {
|
||||||
|
this.myModuleUrl = myModuleUrl;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: myModuleUrl,
|
url: myModuleUrl,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
|
@ -32,6 +33,7 @@ const app = createApp({
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.myModuleParams = null;
|
this.myModuleParams = null;
|
||||||
|
this.myModuleUrl = null;
|
||||||
this.tagsModalOpen = false;
|
this.tagsModalOpen = false;
|
||||||
},
|
},
|
||||||
syncTags(tags) {
|
syncTags(tags) {
|
||||||
|
@ -52,15 +54,13 @@ const app = createApp({
|
||||||
// Canvas
|
// Canvas
|
||||||
if ($('#canvas-container').length) {
|
if ($('#canvas-container').length) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: this.tagsUrl,
|
url: this.myModuleUrl,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success(data) {
|
success(data) {
|
||||||
$.each(data.my_modules, (index, myModule) => {
|
$(`div.panel[data-module-id='${data.data.id}']`)
|
||||||
$(`div.panel[data-module-id='${myModule.id}']`)
|
|
||||||
.find('.edit-tags-link')
|
.find('.edit-tags-link')
|
||||||
.html(myModule.tags_html);
|
.html(data.data.attributes.tags_html);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ module Lists
|
||||||
status
|
status
|
||||||
designated_users
|
designated_users
|
||||||
tags
|
tags
|
||||||
|
tags_html
|
||||||
comments
|
comments
|
||||||
due_date_formatted
|
due_date_formatted
|
||||||
permissions
|
permissions
|
||||||
|
@ -142,6 +143,15 @@ module Lists
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tags_html
|
||||||
|
# legacy canvas support
|
||||||
|
ApplicationController.new.render_to_string(
|
||||||
|
partial: 'canvas/tags',
|
||||||
|
locals: { my_module: object },
|
||||||
|
formats: :html
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def comments
|
def comments
|
||||||
@user = scope[:user] || @instance_options[:user]
|
@user = scope[:user] || @instance_options[:user]
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue