Move snippet-chooser-modal.js to client js

pull/7897/head
Matt Westcott 2022-05-12 11:32:26 +01:00 zatwierdzone przez LB (Ben Johnston)
rodzic 2af6ad3683
commit 1fc66294a4
3 zmienionych plików z 10 dodań i 3 usunięć

Wyświetl plik

@ -139,6 +139,7 @@ module.exports = {
'wagtail/**/**',
'client/src/entrypoints/documents/document-chooser-modal.js',
'client/src/entrypoints/images/image-chooser-modal.js',
'client/src/entrypoints/snippets/snippet-chooser-modal.js',
],
globals: {
$: 'readonly',

Wyświetl plik

@ -1,5 +1,7 @@
SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS = {
choose: function (modal, jsonData) {
import $ from 'jquery';
window.SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS = {
choose: function (modal) {
function ajaxifyLinks(context) {
$('a.snippet-choice', modal.body).on('click', function () {
modal.loadUrl(this.href);

Wyświetl plik

@ -66,7 +66,11 @@ module.exports = function exports(env, argv) {
'document-chooser-modal',
'document-chooser-telepath',
],
'snippets': ['snippet-chooser', 'snippet-chooser-telepath'],
'snippets': [
'snippet-chooser',
'snippet-chooser-modal',
'snippet-chooser-telepath',
],
'contrib/table_block': ['table'],
'contrib/typed_table_block': ['typed_table_block'],
};