소스 검색

Added dynamic tooltip for sidebar tongue

Joel Louzado 8 년 전
부모
커밋
7393818fc0
3개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      client/components/sidebar/sidebar.jade
  2. 7 0
      client/components/sidebar/sidebar.js
  3. 2 0
      i18n/en.i18n.json

+ 1 - 1
client/components/sidebar/sidebar.jade

@@ -1,7 +1,7 @@
 template(name="sidebar")
 template(name="sidebar")
   .board-sidebar.sidebar(class="{{#if isOpen}}is-open{{/if}}")
   .board-sidebar.sidebar(class="{{#if isOpen}}is-open{{/if}}")
     a.sidebar-tongue.js-toggle-sidebar(
     a.sidebar-tongue.js-toggle-sidebar(
-      class="{{#if isTongueHidden}}is-hidden{{/if}}")
+      class="{{#if isTongueHidden}}is-hidden{{/if}}")(title="{{showTongueTitle}}")
       i.fa.fa-angle-left
       i.fa.fa-angle-left
     .sidebar-shadow
     .sidebar-shadow
       .sidebar-content.sidebar-shortcuts
       .sidebar-content.sidebar-shortcuts

+ 7 - 0
client/components/sidebar/sidebar.js

@@ -89,6 +89,13 @@ BlazeComponent.extendComponent({
     return TAPi18n.__(viewTitles[this.getView()]);
     return TAPi18n.__(viewTitles[this.getView()]);
   },
   },
 
 
+  showTongueTitle() {
+    if (this.isOpen())
+      return `${TAPi18n.__('sidebar-close')}`;
+    else 
+      return `${TAPi18n.__('sidebar-open')}`;
+  },
+
   events() {
   events() {
     return [{
     return [{
       'click .js-hide-sidebar': this.hide,
       'click .js-hide-sidebar': this.hide,

+ 2 - 0
i18n/en.i18n.json

@@ -293,6 +293,8 @@
     "shortcut-toggle-filterbar": "Toggle Filter Sidebar",
     "shortcut-toggle-filterbar": "Toggle Filter Sidebar",
     "shortcut-toggle-sidebar": "Toggle Board Sidebar",
     "shortcut-toggle-sidebar": "Toggle Board Sidebar",
     "show-cards-minimum-count": "Show cards count if list contains more than",
     "show-cards-minimum-count": "Show cards count if list contains more than",
+    "sidebar-open": "Open Sidebar",
+    "sidebar-close": "Close Sidebar",
     "signupPopup-title": "Create an Account",
     "signupPopup-title": "Create an Account",
     "star-board-title": "Click to star this board. It will show up at top of your boards list.",
     "star-board-title": "Click to star this board. It will show up at top of your boards list.",
     "starred-boards": "Starred Boards",
     "starred-boards": "Starred Boards",