fix for #75, fix for adding image to entry text
This commit is contained in:
parent
f119bdc773
commit
03c629462b
3 changed files with 15 additions and 9 deletions
8
public/assets/scripts/dash.min.js
vendored
8
public/assets/scripts/dash.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -266,7 +266,8 @@ class MaintenanceManager {
|
|||
}
|
||||
};
|
||||
if (requestType == REQUEST_TYPE_PUT || requestType == REQUEST_TYPE_POST) {
|
||||
//if (eventType === TASK_UPLOAD_FILES) request.setRequestHeader("fipamo-access-token", self.token);
|
||||
if (eventType === TASK_UPLOAD_FILES)
|
||||
request.setRequestHeader("fipamo-access-token", self.token);
|
||||
switch (contentType) {
|
||||
case CONTENT_TYPE_JSON:
|
||||
request.setRequestHeader(
|
||||
|
|
|
@ -20,6 +20,7 @@ export default class PostEditor {
|
|||
this.processing = false;
|
||||
let self = this;
|
||||
this.admin = new FipamoAdminAPI(null);
|
||||
this.mm = new Maintenance();
|
||||
this.urlPieces = document.URL.split("/");
|
||||
this.post = [];
|
||||
this.postID = null;
|
||||
|
@ -250,12 +251,16 @@ export default class PostEditor {
|
|||
handleImageUpload(type, files) {
|
||||
let self = this;
|
||||
notify.alert("Uploading Image", null);
|
||||
let mm = new Maintenance();
|
||||
mm.imageUpload(type, files)
|
||||
|
||||
self.mm
|
||||
.imageUpload(type, files)
|
||||
.then((r) => {
|
||||
if (r.type == DataEvent.POST_IMAGE_ADDED)
|
||||
if (r.type == DataEvent.POST_IMAGE_ADDED) {
|
||||
self.editor.notify(EditorEvent.EDITOR_UPLOAD_POST_IMAGE, r.url);
|
||||
notify.alert("Image Added to Entry", true);
|
||||
notify.alert("Image Added to Entry", true);
|
||||
} else {
|
||||
notify.alert("Uh oh. Image not added", false);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
notify.alert("Uh oh. Image not added", false);
|
||||
|
|
Loading…
Reference in a new issue