소스 검색

HUE-1651 [doc] New user should have default tag selected

Added 'default' tag display if it's the first visit
Fixed a bug on toggling and saving on totalStorage for history and trash
Enrico Berti 12 년 전
부모
커밋
a9974f2
1개의 변경된 파일17개의 추가작업 그리고 11개의 파일을 삭제
  1. 17 11
      desktop/core/src/desktop/templates/home.mako

+ 17 - 11
desktop/core/src/desktop/templates/home.mako

@@ -342,7 +342,7 @@ $(document).ready(function () {
   function toggleSpecificSection(section, filter){
     section.siblings().removeClass("active");
     if (section.hasClass("active")) {
-      populateTable();
+      populateTable("");
       section.removeClass("active");
       section.find("a").blur();
     }
@@ -392,20 +392,26 @@ $(document).ready(function () {
     }
   });
 
-  if ($.totalStorage("hueHomeTags") != null && $.totalStorage("hueHomeTags") != "") {
-    if ($.totalStorage("hueHomeTags") == "history") {
-      $(".viewHistory").click();
-    }
-    else if ($.totalStorage("hueHomeTags") == "trash") {
-      $(".view-trash").click();
+  if ($.totalStorage("hueHomeTags") == null){
+    $("li[data-tag='default']").click(); // for new users show default tag
+  }
+  else {
+    if ($.totalStorage("hueHomeTags") != "") {
+      if ($.totalStorage("hueHomeTags") == "history") {
+        $(".viewHistory").click();
+      }
+      else if ($.totalStorage("hueHomeTags") == "trash") {
+        $(".view-trash").click();
+      }
+      else {
+        $("li[data-tag='" + $.totalStorage("hueHomeTags") + "']").click();
+      }
     }
     else {
-      $("li[data-tag='" + $.totalStorage("hueHomeTags") + "']").click();
+      populateTable();
     }
   }
-  else {
-    populateTable();
-  }
+
 
   $(document).on("click", ".documentTags", function () {
     $("#documentTagsModal").data("document-id", $(this).data("document-id"));