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

Fix #1252, incorrect bookmark icon title
This commit is contained in:
JC Brand 2018-10-26 13:13:06 +02:00 committed by GitHub
commit 98b27fbe0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

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

View File

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