Browse Source

Merge pull request #1271 from Ppjet6/issue-1252-bookmark-title

Fix #1252, incorrect bookmark icon title
JC Brand 6 năm trước cách đây
mục cha
commit
98b27fbe0c
2 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 1 0
      CHANGES.md
  2. 5 0
      src/converse-bookmarks.js

+ 1 - 0
CHANGES.md

@@ -6,6 +6,7 @@
 - Use ES2015 modules instead of UMD.
 - Use ES2015 modules instead of UMD.
 - #1257 Prefer 'probably' over 'maybe' when evaluating audio play support.
 - #1257 Prefer 'probably' over 'maybe' when evaluating audio play support.
 - #1261 File upload not working
 - #1261 File upload not working
+- #1252 Correctly reflect the state in bookmark icon title.
 
 
 ## 4.0.3 (2018-10-22)
 ## 4.0.3 (2018-10-22)
 
 

+ 5 - 0
src/converse-bookmarks.js

@@ -98,14 +98,19 @@ converse.plugins.add('converse-bookmarks', {
             },
             },
 
 
             onBookmarked () {
             onBookmarked () {
+                const { _converse } = this.__super__,
+                      { __ } = _converse;
+
                 const icon = this.el.querySelector('.toggle-bookmark');
                 const icon = this.el.querySelector('.toggle-bookmark');
                 if (_.isNull(icon)) {
                 if (_.isNull(icon)) {
                     return;
                     return;
                 }
                 }
                 if (this.model.get('bookmarked')) {
                 if (this.model.get('bookmarked')) {
                     icon.classList.add('button-on');
                     icon.classList.add('button-on');
+                    icon.title = __('Unbookmark this groupchat');
                 } else {
                 } else {
                     icon.classList.remove('button-on');
                     icon.classList.remove('button-on');
+                    icon.title = __('Bookmark this groupchat');
                 }
                 }
             },
             },