Skip to content
Snippets Groups Projects
Unverified Commit 6f900025 authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Fixed tooltip and migration.

parent ee78eac1
No related branches found
No related tags found
No related merge requests found
......@@ -250,14 +250,14 @@ Template.main.onRendered ->
$(window).on('mouseleave', (e) ->
elem = $(e.fromElement)
avatarElem = elem.find('a.thumb')
avatarElem = elem.find('button.thumb')
if avatarElem.attr('data-username')
RocketChat.tooltip.hide();
)
$(window).on('mouseenter', (e) ->
elem = $(e.fromElement)
avatarElem = elem.find('a.thumb')
avatarElem = elem.find('button.thumb')
username = avatarElem.attr('data-username')
if username
e.stopPropagation()
......
RocketChat.Migrations.add({
version: 51,
version: 54,
up: function() {
// Set default message viewMode to 'normal' or 'cozy' depending on the users' current settings and remove the field 'compactView'
var normalViewUserIds = [],
cozyViewUserIds = [];
RocketChat.models.Users.find().forEach(
function(user) {
if (user.settings && user.settings.preferences && user.settings.preferences.compactView) {
cozyViewUserIds.push(user._id);
} else {
normalViewUserIds.push(user._id);
}
}
);
RocketChat.models.Users.update({_id: {$in: normalViewUserIds}}, {$set: {'settings.preferences.viewMode': 0}});
RocketChat.models.Users.update({_id: {$in: cozyViewUserIds}}, {$set: {'settings.preferences.viewMode': 1}});
RocketChat.models.Users.update({}, {$unset: {'settings.preferences.compactView': ''}}, {multi: true});
if (RocketChat && RocketChat.models && RocketChat.models.Users) {
// Set default message viewMode to 'normal' or 'cozy' depending on the users' current settings and remove the field 'compactView'
RocketChat.models.Users.update({ 'settings.preferences.compactView': true }, { $set: { 'settings.preferences.viewMode': 1 }, $unset: { 'settings.preferences.compactView': 1 } }, { multi: true });
RocketChat.models.Users.update({ 'settings.preferences.viewMode': { $ne: 1 } }, { $set: { 'settings.preferences.viewMode': 0 } }, { multi: true });
}
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment