mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-18 12:11:11 +00:00
Fix JS error in Draftail sources because of script execution order
This commit is contained in:
parent
0f10d42e92
commit
f647c9f270
4 changed files with 4 additions and 8 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import ModalSource from './ModalSource';
|
||||
|
||||
const $ = global.jQuery;
|
||||
const ModalWorkflow = global.ModalWorkflow;
|
||||
|
||||
class DocumentSource extends ModalSource {
|
||||
constructor(props) {
|
||||
|
|
@ -30,7 +29,7 @@ class DocumentSource extends ModalSource {
|
|||
}
|
||||
|
||||
// eslint-disable-next-line new-cap
|
||||
ModalWorkflow({
|
||||
window.ModalWorkflow({
|
||||
url,
|
||||
responses: {
|
||||
documentChosen: this.parseData,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import ModalSource from './ModalSource';
|
||||
|
||||
const $ = global.jQuery;
|
||||
const ModalWorkflow = global.ModalWorkflow;
|
||||
|
||||
class EmbedSource extends ModalSource {
|
||||
constructor(props) {
|
||||
|
|
@ -26,7 +25,7 @@ class EmbedSource extends ModalSource {
|
|||
$(document.body).on('hidden.bs.modal', this.onClose);
|
||||
|
||||
// eslint-disable-next-line new-cap
|
||||
ModalWorkflow({
|
||||
window.ModalWorkflow({
|
||||
url: global.chooserUrls.embedsChooser,
|
||||
responses: {
|
||||
embedChosen: this.parseData,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import ModalSource from './ModalSource';
|
||||
|
||||
const $ = global.jQuery;
|
||||
const ModalWorkflow = global.ModalWorkflow;
|
||||
|
||||
class ImageSource extends ModalSource {
|
||||
constructor(props) {
|
||||
|
|
@ -20,7 +19,7 @@ class ImageSource extends ModalSource {
|
|||
$(document.body).on('hidden.bs.modal', this.onClose);
|
||||
|
||||
// eslint-disable-next-line new-cap
|
||||
ModalWorkflow({
|
||||
window.ModalWorkflow({
|
||||
url: imageChooser,
|
||||
responses: {
|
||||
imageChosen: this.parseData,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import ModalSource from './ModalSource';
|
||||
|
||||
const $ = global.jQuery;
|
||||
const ModalWorkflow = global.ModalWorkflow;
|
||||
|
||||
// Plaster over Wagtail internals.
|
||||
const buildInitialUrl = (entity, openAtParentId, canChooseRoot, pageTypes) => {
|
||||
|
|
@ -89,7 +88,7 @@ class LinkSource extends ModalSource {
|
|||
$(document.body).on('hidden.bs.modal', this.onClose);
|
||||
|
||||
// eslint-disable-next-line new-cap
|
||||
ModalWorkflow({
|
||||
window.ModalWorkflow({
|
||||
url,
|
||||
urlParams,
|
||||
responses: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue