post submission bug fixes, styles fixes for nav section
parent
5decfa92e2
commit
57684e7a27
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,59 +1,49 @@
|
|||||||
import DataUtils,
|
import DataUtils from '../../../../brain/tools/utilities/DataUtils';
|
||||||
{
|
|
||||||
REQUEST_TYPE_GET,
|
|
||||||
REQUEST_TYPE_PUT,
|
|
||||||
REQUEST_TYPE_POST,
|
|
||||||
REQUEST_TYPE_DELETE,
|
|
||||||
CONTENT_TYPE_JSON,
|
|
||||||
CONTENT_TYPE_FORM
|
|
||||||
}
|
|
||||||
from '../../../../brain/tools/utilities/DataUtils';
|
|
||||||
import * as DataEvent from '../../../../brain/tools/events/DataEvent';
|
import * as DataEvent from '../../../../brain/tools/events/DataEvent';
|
||||||
import DashManager from './controllers/DashManager';
|
import DashManager from './controllers/DashManager';
|
||||||
import DBUtils from '../../../../brain/tools/utilities/DBUtils';
|
import DBUtils from '../../../../brain/tools/utilities/DBUtils';
|
||||||
export default class Base
|
export default class Base {
|
||||||
{
|
//--------------------------
|
||||||
//--------------------------
|
// constructor
|
||||||
// constructor
|
//--------------------------
|
||||||
//--------------------------
|
constructor() {
|
||||||
constructor()
|
this.dashManager = [];
|
||||||
{
|
this.dataUtils = new DataUtils();
|
||||||
var self = this;
|
this.dbUtils = new DBUtils();
|
||||||
this.dashManager = [];
|
this.settings = [];
|
||||||
this.dataUtils = new DataUtils();
|
this.storeLocalData();
|
||||||
this.dbUtils = new DBUtils();
|
}
|
||||||
this.settings = [];
|
start() {
|
||||||
this.storeLocalData();
|
this.dashManager = new DashManager();
|
||||||
}
|
}
|
||||||
start()
|
//--------------------------
|
||||||
{
|
// methods
|
||||||
this.dashManager = new DashManager();
|
//--------------------------
|
||||||
}
|
storeLocalData() {
|
||||||
//--------------------------
|
var self = this;
|
||||||
// methods
|
this.dataUtils
|
||||||
//--------------------------
|
.request('/api/post/json', DataEvent.SETTINGS_LOADED)
|
||||||
storeLocalData()
|
.then(response => {
|
||||||
{
|
let posts = JSON.parse(response.request['response']);
|
||||||
var self = this;
|
|
||||||
this.dataUtils.request('/api/post/json', DataEvent.SETTINGS_LOADED).then((response) =>
|
|
||||||
{
|
|
||||||
let posts = JSON.parse(response.request['response']);
|
|
||||||
|
|
||||||
let list = [];
|
let list = [];
|
||||||
for (let index = 0; index < posts.length; index++) {
|
for (let index = 0; index < posts.length; index++) {
|
||||||
list.push({id:posts[index].id ,post:posts[index].post});
|
list.push({ id: posts[index].id, post: posts[index].post });
|
||||||
}
|
}
|
||||||
self.dbUtils.syncLocal(list).then(r=>{
|
self.dbUtils
|
||||||
self.start();
|
.syncLocal(list)
|
||||||
}).catch(err=>{
|
.then(() => {
|
||||||
console.log(err);
|
self.start();
|
||||||
});
|
})
|
||||||
}).catch((err) =>
|
.catch(() => {
|
||||||
{
|
//console.log(err);
|
||||||
console.log(err);
|
});
|
||||||
});
|
})
|
||||||
}
|
.catch(() => {
|
||||||
//--------------------------
|
//console.log(err);
|
||||||
// event handlers
|
});
|
||||||
//--------------------------
|
}
|
||||||
|
//--------------------------
|
||||||
|
// event handlers
|
||||||
|
//--------------------------
|
||||||
}
|
}
|
Loading…
Reference in New Issue