Browse Source

Added grey muted badges

master
Igor Zhukov 9 years ago
parent
commit
faaffc9b6e
  1. 27
      app/js/directives.js
  2. 3
      app/less/app.less
  3. 1
      app/partials/desktop/dialog.html
  4. 1
      app/partials/mobile/dialog.html

27
app/js/directives.js

@ -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) { .directive('myPeerLink', function (AppChatsManager, AppUsersManager) {
return { return {

3
app/less/app.less

@ -1243,6 +1243,9 @@ a.im_dialog_selected {
.im_dialogs_modal_col & { .im_dialogs_modal_col & {
display: none; display: none;
} }
&_muted {
background: #ccc;
}
} }
.im_dialog_unread { .im_dialog_unread {

1
app/partials/desktop/dialog.html

@ -6,6 +6,7 @@
class="im_dialog_badge badge" class="im_dialog_badge badge"
ng-show="dialogMessage.unreadCount > 0 && !dialogMessage.pFlags.out" ng-show="dialogMessage.unreadCount > 0 && !dialogMessage.pFlags.out"
ng-bind="dialogMessage.unreadCount" ng-bind="dialogMessage.unreadCount"
my-peer-muted="dialogMessage.peerID" muted-class="im_dialog_badge_muted"
></span> ></span>
<i <i
class="im_dialog_unread" class="im_dialog_unread"

1
app/partials/mobile/dialog.html

@ -6,6 +6,7 @@
class="im_dialog_badge badge" class="im_dialog_badge badge"
ng-show="dialogMessage.unreadCount > 0 && !dialogMessage.pFlags.out" ng-show="dialogMessage.unreadCount > 0 && !dialogMessage.pFlags.out"
ng-bind="dialogMessage.unreadCount" ng-bind="dialogMessage.unreadCount"
my-peer-muted="dialogMessage.peerID" muted-class="im_dialog_badge_muted"
></span> ></span>
<i <i
class="im_dialog_unread" class="im_dialog_unread"

Loading…
Cancel
Save