mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-02-22 13:05:26 +08:00

- Moved Code-editor from vue to component. - Updated popup code so it background click only hides if the click originated on the same background. Clicks within the popup will no longer cause it to hide. - Added session-level history tracking to code editor.
37 lines
857 B
JavaScript
37 lines
857 B
JavaScript
import Vue from "vue";
|
|
|
|
function exists(id) {
|
|
return document.getElementById(id) !== null;
|
|
}
|
|
|
|
import entityDashboard from "./entity-dashboard";
|
|
import imageManager from "./image-manager";
|
|
import tagManager from "./tag-manager";
|
|
import attachmentManager from "./attachment-manager";
|
|
import pageEditor from "./page-editor";
|
|
|
|
let vueMapping = {
|
|
'entity-dashboard': entityDashboard,
|
|
'image-manager': imageManager,
|
|
'tag-manager': tagManager,
|
|
'attachment-manager': attachmentManager,
|
|
'page-editor': pageEditor,
|
|
};
|
|
|
|
window.vues = {};
|
|
|
|
function load() {
|
|
let ids = Object.keys(vueMapping);
|
|
for (let i = 0, len = ids.length; i < len; i++) {
|
|
if (!exists(ids[i])) continue;
|
|
let config = vueMapping[ids[i]];
|
|
config.el = '#' + ids[i];
|
|
window.vues[ids[i]] = new Vue(config);
|
|
}
|
|
}
|
|
|
|
export default load;
|
|
|
|
|
|
|