diff --git a/module/index.js b/module/index.js index ab845c7..2aad433 100644 --- a/module/index.js +++ b/module/index.js @@ -171,6 +171,10 @@ export function init(baseURL='/', baseFlowURL='/', baseParams={}) { // Initialize the page flow manager flowMgr.init('[data-cf-flow]', new FlowAPI(baseFlowURL, baseParams)) + // Create an element in which manhattan specific UI elements should be + // rooted. + document.body.appendChild($.create('div', {'data-mh-content-ui': ''})) + // Configure save behaviour for flows and global content // Flows diff --git a/module/tools/imagery.js b/module/tools/imagery.js index 4649f24..de27de8 100644 --- a/module/tools/imagery.js +++ b/module/tools/imagery.js @@ -68,7 +68,10 @@ class ImageTool extends ContentTools.Tool { } else { // Make the upload URL configurable - const imageUploader = new ImageUploader(ImageTool.uploadURL) + const imageUploader = new ImageUploader( + ImageTool.uploadURL, + $.one('[data-mh-content-ui]') + ) imageUploader.init() imageUploader.show() @@ -174,7 +177,8 @@ class ImageTool extends ContentTools.Tool { imageURL, cropRatio, fixCropRatio, - [600, 600] + [600, 600], + $.one('[data-mh-content-ui]') ) imageEditor.init() imageEditor.show() diff --git a/module/ui/imagery.js b/module/ui/imagery.js index 0af413c..0c1cbbb 100644 --- a/module/ui/imagery.js +++ b/module/ui/imagery.js @@ -11,8 +11,8 @@ import {Uploader} from 'manhattan-assets/module/ui/uploader' */ export class ImageUploader extends Overlay { - constructor(uploadURL) { - super() + constructor(uploadURL, container=null) { + super(container) // The URL images should be uploaded to this._uploadURL = uploadURL diff --git a/package.json b/package.json index 9260388..4ecb572 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "manhattan-content", - "version": "1.0.0-beta.2", + "version": "1.0.0-beta.3", "description": "Content editing for the manhattan web framework", "engines": { "node": ">=8.9.4" diff --git a/scss/content.scss b/scss/content.scss index 45b2c6a..a0bb98f 100644 --- a/scss/content.scss +++ b/scss/content.scss @@ -1,2 +1,4 @@ -@import 'ui/image-uploader'; \ No newline at end of file +[data-mh-content-ui] { + @import 'ui/image-uploader'; +} \ No newline at end of file