Load tags right away, 3.0.3-beta2

This commit is contained in:
Mo Bitar
2019-01-14 18:53:27 -06:00
parent 348276e3e2
commit 7a403f69c1
4 changed files with 15 additions and 13 deletions

View File

@@ -18,17 +18,18 @@ angular.module('app')
}
})
.controller('TagsCtrl', function ($rootScope, modelManager, syncManager, $timeout, componentManager, authManager) {
let initialLoad = true;
// Wrap in timeout so that selectTag is defined
$timeout(() => {
this.smartTags = modelManager.getSmartTags();
this.selectTag(this.smartTags[0]);
})
syncManager.addEventHandler((syncEvent, data) => {
if(syncEvent == "initial-data-loaded" || syncEvent == "sync:completed") {
if(syncEvent == "local-data-loaded"
|| syncEvent == "sync:completed"
|| syncEvent == "local-data-incremental-load") {
this.tags = modelManager.tags;
this.smartTags = modelManager.getSmartTags();
if(initialLoad) {
initialLoad = false;
this.selectTag(this.smartTags[0]);
}
}
});

View File

@@ -17,6 +17,7 @@
"ng-class" => "{'selected' : ctrl.selectedTag == tag, 'faded' : !tag.content.isAllTag}"}
.info
%input.title{"ng-disabled" => "true", "ng-model" => "tag.title"}
.count{"ng-show" => "tag.content.isAllTag"} {{ctrl.noteCount(tag)}}
.tags-title-section.section-title-bar
.section-title-bar-header