Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-02-27 22:10:40 +0300
committerJulius Härtl <jus@bitgrid.net>2019-02-27 22:10:40 +0300
commit719ae492d143ffc87e27d488df64c227ce7299f5 (patch)
treee98311ed8deb4b8af40102d715442626350d82c8 /js/documents.js
parent43be81e7368c342bddfb49a14bbf20533b9db513 (diff)
Allow to uncheck follow current user
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'js/documents.js')
-rw-r--r--js/documents.js21
1 files changed, 14 insertions, 7 deletions
diff --git a/js/documents.js b/js/documents.js
index 5d0cc179..7e685124 100644
--- a/js/documents.js
+++ b/js/documents.js
@@ -313,7 +313,7 @@ var documentsMain = {
} else {
$(avatar).attr('title', view.UserName);
}
- $(avatar).avatar(view.UserId, 32);
+ $(avatar).avatar(view.UserId, 32, undefined, true, undefined, view.UserName);
if (parent.OC.currentUser !== null && view.UserId !== '') {
//$(avatar).contactsMenu(view.UserId, 0, avatarContainer);
}
@@ -348,17 +348,24 @@ var documentsMain = {
}
};
var followCurrentEditor = $('<li><input type="checkbox" class="checkbox" /><label class="label">' + t('richdocuments', 'Follow current editor') + '</label></li>');
- followCurrentEditor.click(function(event) {
+ followCurrentEditor.find('label').click(function(event) {
event.stopPropagation();
- documentsMain.UI.followCurrentEditor();
+ if (documentsMain.UI.followingEditor) {
+ documentsMain.UI.followReset();
+ } else {
+ documentsMain.UI.followCurrentEditor();
+ }
});
- if (this.followingEditor) {
- popover.find('li.active').removeClass('active');
- followCurrentEditor.find('.checkbox').prop('checked', true);
- }
+ followCurrentEditor.find('.checkbox').prop('checked', documentsMain.UI.followingEditor);
popover.find('ul').append(followCurrentEditor);
avatardiv.append(popover)
},
+ followReset: function(event) {
+ documentsMain.WOPIPostMessage($('#loleafletframe')[0], 'Action_FollowUser', {Follow: false});
+ this.following = null;
+ this.followingEditor = false;
+ this.renderAvatars();
+ },
followCurrentEditor: function(event) {
documentsMain.WOPIPostMessage($('#loleafletframe')[0], 'Action_FollowUser', {Follow: true});
this.following = null;