mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-15 16:58:42 +00:00
Fixes that may break things
This commit is contained in:
parent
7fa4daa8d5
commit
86dfb12b07
|
|
@ -337,17 +337,17 @@
|
||||||
{
|
{
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (self.xhr.readyState !== 1) {
|
if (this.xhr.readyState !== 1) {
|
||||||
self.xhr.open(this.method, jsOMS.Uri.UriFactory.build(this.uri));
|
this.xhr.open(this.method, jsOMS.Uri.UriFactory.build(this.uri));
|
||||||
|
|
||||||
for (let p in this.requestHeader) {
|
for (let p in this.requestHeader) {
|
||||||
if (this.requestHeader.hasOwnProperty(p)) {
|
if (this.requestHeader.hasOwnProperty(p)) {
|
||||||
self.xhr.setRequestHeader(p, this.requestHeader[p]);
|
this.xhr.setRequestHeader(p, this.requestHeader[p]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.xhr.onreadystatechange = function ()
|
this.xhr.onreadystatechange = function ()
|
||||||
{
|
{
|
||||||
switch (self.xhr.readyState) {
|
switch (self.xhr.readyState) {
|
||||||
case 4:
|
case 4:
|
||||||
|
|
@ -370,12 +370,12 @@
|
||||||
|
|
||||||
if (this.type === jsOMS.Message.Request.RequestType.JSON) {
|
if (this.type === jsOMS.Message.Request.RequestType.JSON) {
|
||||||
if (typeof this.requestHeader !== 'undefined' && this.requestHeader['Content-Type'] === 'application/json') {
|
if (typeof this.requestHeader !== 'undefined' && this.requestHeader['Content-Type'] === 'application/json') {
|
||||||
self.xhr.send(JSON.stringify(this.data));
|
this.xhr.send(JSON.stringify(this.data));
|
||||||
} else {
|
} else {
|
||||||
self.xhr.send(this.queryfy(this.data));
|
this.xhr.send(this.queryfy(this.data));
|
||||||
}
|
}
|
||||||
} else if (this.type === jsOMS.Message.Request.RequestType.RAW) {
|
} else if (this.type === jsOMS.Message.Request.RequestType.RAW) {
|
||||||
self.xhr.send(this.data);
|
this.xhr.send(this.data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}(window.jsOMS = window.jsOMS || {}));
|
}(window.jsOMS = window.jsOMS || {}));
|
||||||
|
|
|
||||||
|
|
@ -164,8 +164,8 @@
|
||||||
for (let property in injects) {
|
for (let property in injects) {
|
||||||
if (injects.hasOwnProperty(property)) {
|
if (injects.hasOwnProperty(property)) {
|
||||||
counter++;
|
counter++;
|
||||||
this.app.eventManager.addGroup(form.getId(), counter);
|
//this.app.eventManager.addGroup(form.getId(), counter);
|
||||||
const result = injects[property](form, counter, form.getId());
|
const result = injects[property](form, form.getId());
|
||||||
|
|
||||||
if (result === false) {
|
if (result === false) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -175,9 +175,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (counter === 0) {
|
this.app.eventManager.trigger(form.getId());
|
||||||
this.app.eventManager.trigger(form.getId());
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -215,6 +213,8 @@
|
||||||
request.setRequestHeader('Content-Type', 'application/json');
|
request.setRequestHeader('Content-Type', 'application/json');
|
||||||
request.setSuccess(function (xhr)
|
request.setSuccess(function (xhr)
|
||||||
{
|
{
|
||||||
|
console.log(xhr.response);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const o = JSON.parse(xhr.response),
|
const o = JSON.parse(xhr.response),
|
||||||
response = new jsOMS.Message.Response.Response(o),
|
response = new jsOMS.Message.Response.Response(o),
|
||||||
|
|
@ -224,11 +224,7 @@
|
||||||
|
|
||||||
if (typeof o.status !== 'undefined') {
|
if (typeof o.status !== 'undefined') {
|
||||||
self.app.notifyManager.send(
|
self.app.notifyManager.send(
|
||||||
new jsOMS.Message.Notification.NotificationMessage(
|
new jsOMS.Message.Notification.NotificationMessage(o.status, o.title, o.message), jsOMS.Message.Notification.NotificationType.APP_NOTIFICATION
|
||||||
o.status,
|
|
||||||
o.title,
|
|
||||||
o.message
|
|
||||||
), jsOMS.Message.Notification.NotificationType.APP_NOTIFICATION
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user