move & rename
This commit is contained in:
parent
be1cafa579
commit
102d0a7d7a
17
src/app.js
17
src/app.js
|
@ -3,11 +3,11 @@ import "bootstrap/scss/bootstrap.scss";
|
||||||
import "babel-polyfill";
|
import "babel-polyfill";
|
||||||
import angularStickyfill from "angular-stickyfill";
|
import angularStickyfill from "angular-stickyfill";
|
||||||
import "angular-stickyfill/dist/angular-stickyfill.css";
|
import "angular-stickyfill/dist/angular-stickyfill.css";
|
||||||
import {cleanUsername, generateRandomUsername} from "./util";
|
import {cleanUsername, generateRandomUsername} from "./mailbox/util";
|
||||||
import hasher from "hasher";
|
import hasher from "hasher";
|
||||||
import Header from "./components/header/header";
|
import Header from "./mailbox/header/header";
|
||||||
import List from "./components/list/list";
|
import List from "./mailbox/list/list";
|
||||||
import Mail from "./components/mail/mail";
|
import Mail from "./mailbox/mail/mail";
|
||||||
|
|
||||||
// config:
|
// config:
|
||||||
const reload_interval_ms = 10000;
|
const reload_interval_ms = 10000;
|
||||||
|
@ -15,21 +15,16 @@ const backend_url = './backend.php';
|
||||||
|
|
||||||
class AppController {
|
class AppController {
|
||||||
/*@ngInject*/
|
/*@ngInject*/
|
||||||
constructor($http, $log, config, $interval) {
|
constructor($http, $log, $interval) {
|
||||||
this.$interval = $interval;
|
this.$interval = $interval;
|
||||||
this.$http = $http;
|
this.$http = $http;
|
||||||
this.config = config;
|
|
||||||
this.$log = $log;
|
this.$log = $log;
|
||||||
this.$log.log('start controller');
|
|
||||||
this.address = null;
|
this.address = null;
|
||||||
this.username = null;
|
this.username = null;
|
||||||
this.mails = [];
|
this.mails = [];
|
||||||
this.state = {isUpdating: false};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$onInit() {
|
$onInit() {
|
||||||
this.$log.debug("init");
|
|
||||||
|
|
||||||
hasher.changed.add(this.onHashChange.bind(this));
|
hasher.changed.add(this.onHashChange.bind(this));
|
||||||
hasher.initialized.add(this.onHashChange.bind(this)); //add initialized listener (to grab initial value in case it is already set)
|
hasher.initialized.add(this.onHashChange.bind(this)); //add initialized listener (to grab initial value in case it is already set)
|
||||||
hasher.init(); //initialize hasher (start listening for history changes)
|
hasher.init(); //initialize hasher (start listening for history changes)
|
||||||
|
@ -64,12 +59,10 @@ class AppController {
|
||||||
|
|
||||||
loadEmailsAsync(username) {
|
loadEmailsAsync(username) {
|
||||||
this.$log.debug("updating mails for ", username);
|
this.$log.debug("updating mails for ", username);
|
||||||
this.state.isUpdating = true;
|
|
||||||
this.loadEmails(this.username).then(data=> {
|
this.loadEmails(this.username).then(data=> {
|
||||||
this.mails = data.mails;
|
this.mails = data.mails;
|
||||||
this.address = data.address;
|
this.address = data.address;
|
||||||
this.username = data.username;
|
this.username = data.username;
|
||||||
this.state.isUpdating = false;
|
|
||||||
this.$log.debug("received mails for ", username);
|
this.$log.debug("received mails for ", username);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Loading…
Reference in New Issue
Block a user