remove dialogSet from global scope

move function into seperate file to avoid circular import
This commit is contained in:
Leo McArdle 2021-11-03 11:53:30 +00:00 коммит произвёл Leo McArdle
Родитель 125da2df38
Коммит dc6c36855b
5 изменённых файлов: 13 добавлений и 15 удалений

Просмотреть файл

@ -9,6 +9,7 @@
* if you want to avoid that).
*/
import dialogSet from "sumo/js/upload-dialog";
/**
* Wrap an input in its own form and bind delete handlers.

Просмотреть файл

@ -0,0 +1,11 @@
export default function dialogSet(inner, title) {
var kbox = new KBox($('<p/>').text(inner), {
title: title,
destroy: true,
closeOnOutClick: true,
modal: true,
id: 'upload-dialog',
container: $('body')
});
kbox.open();
}

Просмотреть файл

@ -1,16 +1,5 @@
import "sumo/js/libs/jquery.ajaxupload";
function dialogSet(inner, title) {
var kbox = new KBox($('<p/>').text(inner), {
title: title,
destroy: true,
closeOnOutClick: true,
modal: true,
id: 'upload-dialog',
container: $('body')
});
kbox.open();
}
import dialogSet from "sumo/js/upload-dialog";
$(document).ready(function () {
var UPLOAD = {

Просмотреть файл

@ -30,7 +30,6 @@ module.exports = {
"detailsInit": "readonly",
"tabsInit": "readonly",
"trackEvent": "readonly",
"dialogSet": "readonly",
"$": "readonly",
"jQuery": "readonly",
"diff_match_patch": "readonly",

Просмотреть файл

@ -3,8 +3,6 @@
// in webpack, unless a file explicitly places a variable under `window.`,
// we have to expose each of these variables manually:
module.exports = [
// wrap these files to make them behave like an es6 module, exporting the named variable, and expose that globally:
exportAndExpose("../kitsune/sumo/static/sumo/js/upload.js", "dialogSet"),
// we copy these libraries from external sources, so define their exports here,
// rather than having to modify them, making updating them more difficult:
exports(