Emits itemEditionMessage in more contexts.
This commit is contained in:
parent
2641608f81
commit
e3edafaab9
|
@ -1337,13 +1337,14 @@ export default {
|
||||||
this.onPrevInSequence();
|
this.onPrevInSequence();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
parent.postMessage({
|
|
||||||
type: 'itemEditionMessage',
|
|
||||||
item: this.item
|
|
||||||
},
|
|
||||||
tainacan_plugin.admin_url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sends info to iframe containing item edition form and other use cases
|
||||||
|
parent.postMessage({
|
||||||
|
type: 'itemEditionMessage',
|
||||||
|
item: this.$adminOptions.itemEditionMode ? this.item : null
|
||||||
|
},
|
||||||
|
tainacan_plugin.admin_url);
|
||||||
})
|
})
|
||||||
.catch((errors) => {
|
.catch((errors) => {
|
||||||
|
|
||||||
|
@ -1367,12 +1368,12 @@ export default {
|
||||||
onDiscard() {
|
onDiscard() {
|
||||||
if (!this.$adminOptions.itemEditionMode)
|
if (!this.$adminOptions.itemEditionMode)
|
||||||
this.$router.go(-1);
|
this.$router.go(-1);
|
||||||
else
|
|
||||||
parent.postMessage({
|
parent.postMessage({
|
||||||
type: 'itemEditionMessage',
|
type: 'itemEditionMessage',
|
||||||
item: null
|
item: this.$adminOptions.itemEditionMode ? false : null
|
||||||
},
|
},
|
||||||
tainacan_plugin.admin_url);
|
tainacan_plugin.admin_url);
|
||||||
|
|
||||||
},
|
},
|
||||||
createNewItem() {
|
createNewItem() {
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
const message = event.message ? 'message' : 'data';
|
const message = event.message ? 'message' : 'data';
|
||||||
const data = event[message];
|
const data = event[message];
|
||||||
|
|
||||||
if (data.type == 'itemEditionMessage') {
|
if (data.type == 'itemEditionMessage' && data.item !== null) {
|
||||||
this.editItemModal = false;
|
this.editItemModal = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -406,7 +406,7 @@
|
||||||
const message = event.message ? 'message' : 'data';
|
const message = event.message ? 'message' : 'data';
|
||||||
const data = event[message];
|
const data = event[message];
|
||||||
|
|
||||||
if (data.type == 'itemEditionMessage') {
|
if (data.type == 'itemEditionMessage' && data.item !== null) {
|
||||||
this.editItemModalOpen = false;
|
this.editItemModalOpen = false;
|
||||||
|
|
||||||
// An item is being edited from the modal
|
// An item is being edited from the modal
|
||||||
|
|
Loading…
Reference in New Issue