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,
|
||||
{
|
||||
REQUEST_TYPE_GET,
|
||||
REQUEST_TYPE_PUT,
|
||||
REQUEST_TYPE_POST,
|
||||
REQUEST_TYPE_DELETE,
|
||||
CONTENT_TYPE_JSON,
|
||||
CONTENT_TYPE_FORM
|
||||
}
|
||||
from '../../../../brain/tools/utilities/DataUtils';
|
||||
import DataUtils from '../../../../brain/tools/utilities/DataUtils';
|
||||
import * as DataEvent from '../../../../brain/tools/events/DataEvent';
|
||||
import DashManager from './controllers/DashManager';
|
||||
import DBUtils from '../../../../brain/tools/utilities/DBUtils';
|
||||
export default class Base
|
||||
{
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor()
|
||||
{
|
||||
var self = this;
|
||||
this.dashManager = [];
|
||||
this.dataUtils = new DataUtils();
|
||||
this.dbUtils = new DBUtils();
|
||||
this.settings = [];
|
||||
this.storeLocalData();
|
||||
}
|
||||
start()
|
||||
{
|
||||
this.dashManager = new DashManager();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
storeLocalData()
|
||||
{
|
||||
var self = this;
|
||||
this.dataUtils.request('/api/post/json', DataEvent.SETTINGS_LOADED).then((response) =>
|
||||
{
|
||||
let posts = JSON.parse(response.request['response']);
|
||||
export default class Base {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {
|
||||
this.dashManager = [];
|
||||
this.dataUtils = new DataUtils();
|
||||
this.dbUtils = new DBUtils();
|
||||
this.settings = [];
|
||||
this.storeLocalData();
|
||||
}
|
||||
start() {
|
||||
this.dashManager = new DashManager();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
storeLocalData() {
|
||||
var self = this;
|
||||
this.dataUtils
|
||||
.request('/api/post/json', DataEvent.SETTINGS_LOADED)
|
||||
.then(response => {
|
||||
let posts = JSON.parse(response.request['response']);
|
||||
|
||||
let list = [];
|
||||
for (let index = 0; index < posts.length; index++) {
|
||||
list.push({id:posts[index].id ,post:posts[index].post});
|
||||
}
|
||||
self.dbUtils.syncLocal(list).then(r=>{
|
||||
self.start();
|
||||
}).catch(err=>{
|
||||
console.log(err);
|
||||
});
|
||||
}).catch((err) =>
|
||||
{
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
let list = [];
|
||||
for (let index = 0; index < posts.length; index++) {
|
||||
list.push({ id: posts[index].id, post: posts[index].post });
|
||||
}
|
||||
self.dbUtils
|
||||
.syncLocal(list)
|
||||
.then(() => {
|
||||
self.start();
|
||||
})
|
||||
.catch(() => {
|
||||
//console.log(err);
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
//console.log(err);
|
||||
});
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
}
|
Loading…
Reference in New Issue