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) { .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) => { 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.tags = modelManager.tags;
this.smartTags = modelManager.getSmartTags(); 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}"} "ng-class" => "{'selected' : ctrl.selectedTag == tag, 'faded' : !tag.content.isAllTag}"}
.info .info
%input.title{"ng-disabled" => "true", "ng-model" => "tag.title"} %input.title{"ng-disabled" => "true", "ng-model" => "tag.title"}
.count{"ng-show" => "tag.content.isAllTag"} {{ctrl.noteCount(tag)}}
.tags-title-section.section-title-bar .tags-title-section.section-title-bar
.section-title-bar-header .section-title-bar-header

8
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "standard-notes-web", "name": "standard-notes-web",
"version": "3.0.3-beta1", "version": "3.0.3-beta2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -8097,9 +8097,9 @@
"dev": true "dev": true
}, },
"standard-file-js": { "standard-file-js": {
"version": "0.3.32", "version": "0.3.34",
"resolved": "https://registry.npmjs.org/standard-file-js/-/standard-file-js-0.3.32.tgz", "resolved": "https://registry.npmjs.org/standard-file-js/-/standard-file-js-0.3.34.tgz",
"integrity": "sha512-1QP7IJ3MJC+5av9bXVy1IIxBnZy2PzcEW+b835XRC2N4bEEIPWMnabozlPLhErBe/Ey1mxvwltsG39mGGST2tA==", "integrity": "sha512-N9Te01iArvtUuLeCB9z9/uBJDiMDqRyTPuvDJz/kanK8LzOJGQVjs76PUbud2TQMZ8CnIAXNVdqed0FmC0UjJg==",
"dev": true "dev": true
}, },
"static-extend": { "static-extend": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "standard-notes-web", "name": "standard-notes-web",
"version": "3.0.3-beta1", "version": "3.0.3-beta2",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -45,7 +45,7 @@
"serve-static": "^1.13.2", "serve-static": "^1.13.2",
"sn-models": "0.1.12", "sn-models": "0.1.12",
"sn-stylekit": "2.0.13", "sn-stylekit": "2.0.13",
"standard-file-js": "0.3.32", "standard-file-js": "0.3.34",
"grunt-shell": "^2.1.0" "grunt-shell": "^2.1.0"
} }
} }