Skip to content

Commit

Permalink
Updated the library to allow manhattan image editor support to be nam…
Browse files Browse the repository at this point in the history
…espaced preventing conflicts with frontend use of the library
  • Loading branch information
anthonyjb committed Aug 12, 2018
1 parent b27384b commit 8219d8c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions module/tools/imagery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions module/ui/imagery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 3 additions & 1 deletion scss/content.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

@import 'ui/image-uploader';
[data-mh-content-ui] {
@import 'ui/image-uploader';
}

0 comments on commit 8219d8c

Please sign in to comment.