Added grey muted badges
This commit is contained in:
parent
5b98c89d08
commit
faaffc9b6e
@ -2666,6 +2666,33 @@ angular.module('myApp.directives', ['myApp.filters'])
|
||||
}
|
||||
})
|
||||
|
||||
.directive('myPeerMuted', function ($rootScope, NotificationsManager) {
|
||||
|
||||
return {
|
||||
link: link
|
||||
};
|
||||
|
||||
function link ($scope, element, attrs) {
|
||||
var peerID = $scope.$eval(attrs.myPeerMuted);
|
||||
var className = attrs.mutedClass || 'muted';
|
||||
var unsubscribe = $rootScope.$on('notify_settings', function (e, data) {
|
||||
if (data.peerID == peerID) {
|
||||
updateClass(peerID, element, className);
|
||||
}
|
||||
});
|
||||
updateClass(peerID, element, className);
|
||||
|
||||
$scope.$on('$destroy', unsubscribe);
|
||||
}
|
||||
|
||||
function updateClass (peerID, element, className) {
|
||||
NotificationsManager.getPeerMuted(peerID).then(function (muted) {
|
||||
element.toggleClass(className, muted);
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.directive('myPeerLink', function (AppChatsManager, AppUsersManager) {
|
||||
|
||||
return {
|
||||
|
@ -1243,6 +1243,9 @@ a.im_dialog_selected {
|
||||
.im_dialogs_modal_col & {
|
||||
display: none;
|
||||
}
|
||||
&_muted {
|
||||
background: #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.im_dialog_unread {
|
||||
|
@ -6,6 +6,7 @@
|
||||
class="im_dialog_badge badge"
|
||||
ng-show="dialogMessage.unreadCount > 0 && !dialogMessage.pFlags.out"
|
||||
ng-bind="dialogMessage.unreadCount"
|
||||
my-peer-muted="dialogMessage.peerID" muted-class="im_dialog_badge_muted"
|
||||
></span>
|
||||
<i
|
||||
class="im_dialog_unread"
|
||||
|
@ -6,6 +6,7 @@
|
||||
class="im_dialog_badge badge"
|
||||
ng-show="dialogMessage.unreadCount > 0 && !dialogMessage.pFlags.out"
|
||||
ng-bind="dialogMessage.unreadCount"
|
||||
my-peer-muted="dialogMessage.peerID" muted-class="im_dialog_badge_muted"
|
||||
></span>
|
||||
<i
|
||||
class="im_dialog_unread"
|
||||
|
Loading…
x
Reference in New Issue
Block a user