functional minimalism
This commit is contained in:
@@ -88,7 +88,7 @@ angular.module('app.frontend')
|
||||
}
|
||||
}
|
||||
})
|
||||
.controller('EditorCtrl', function ($sce, $timeout, apiController, markdownRenderer, $rootScope, extensionManager, syncManager) {
|
||||
.controller('EditorCtrl', function ($sce, $timeout, authManager, markdownRenderer, $rootScope, extensionManager, syncManager) {
|
||||
|
||||
this.setNote = function(note, oldNote) {
|
||||
this.editorMode = 'edit';
|
||||
@@ -149,7 +149,7 @@ angular.module('app.frontend')
|
||||
if(statusTimeout) $timeout.cancel(statusTimeout);
|
||||
statusTimeout = $timeout(function(){
|
||||
var status = "All changes saved"
|
||||
if(syncManager.offline) {
|
||||
if(authManager.offline()) {
|
||||
status += " (offline)";
|
||||
}
|
||||
this.saveError = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
angular.module('app.frontend')
|
||||
.directive("header", function(apiController){
|
||||
.directive("header", function(authManager){
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {},
|
||||
@@ -22,17 +22,17 @@ angular.module('app.frontend')
|
||||
}
|
||||
}
|
||||
})
|
||||
.controller('HeaderCtrl', function (apiController, modelManager, $timeout, dbManager, syncManager) {
|
||||
.controller('HeaderCtrl', function (authManager, modelManager, $timeout, dbManager, syncManager) {
|
||||
|
||||
this.user = apiController.user;
|
||||
this.user = authManager.user;
|
||||
|
||||
this.updateOfflineStatus = function() {
|
||||
this.offline = syncManager.offline;
|
||||
this.offline = authManager.offline();
|
||||
}
|
||||
this.updateOfflineStatus();
|
||||
|
||||
this.findErrors = function() {
|
||||
this.error = syncManager.syncProviders.filter(function(provider){return provider.error}).length > 0 ? true : false;
|
||||
this.error = syncManager.error;
|
||||
}
|
||||
this.findErrors();
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
angular.module('app.frontend')
|
||||
.controller('HomeCtrl', function ($scope, $rootScope, $timeout, modelManager, syncManager) {
|
||||
.controller('HomeCtrl', function ($scope, $rootScope, $timeout, modelManager, syncManager, authManager) {
|
||||
$rootScope.bodyClass = "app-body-class";
|
||||
|
||||
syncManager.loadLocalItems(function(items){
|
||||
syncManager.loadLocalItems(function(items) {
|
||||
$scope.$apply();
|
||||
|
||||
syncManager.sync(null);
|
||||
@@ -138,7 +138,7 @@ angular.module('app.frontend')
|
||||
}
|
||||
|
||||
syncManager.sync(function(){
|
||||
if(syncManager.offline) {
|
||||
if(authManager.offline()) {
|
||||
// when deleting items while ofline, we need to explictly tell angular to refresh UI
|
||||
setTimeout(function () {
|
||||
$scope.safeApply();
|
||||
|
||||
@@ -24,7 +24,7 @@ angular.module('app.frontend')
|
||||
}
|
||||
}
|
||||
})
|
||||
.controller('NotesCtrl', function (apiController, $timeout, $rootScope, modelManager) {
|
||||
.controller('NotesCtrl', function (authManager, $timeout, $rootScope, modelManager) {
|
||||
|
||||
$rootScope.$on("editorFocused", function(){
|
||||
this.showMenu = false;
|
||||
|
||||
Reference in New Issue
Block a user