Commit 706c1fe0 authored by Vladimir Baranov's avatar Vladimir Baranov

rfix #5402. Fix messaging window dissapearance

parent ce11ec8c
...@@ -2087,7 +2087,7 @@ table.dataTable thead .sorting:after { ...@@ -2087,7 +2087,7 @@ table.dataTable thead .sorting:after {
right: 15px; right: 15px;
-moz-box-shadow: 0px 0px 45px rgba(0,0,0,0.4); -moz-box-shadow: 0px 0px 45px rgba(0,0,0,0.4);
box-shadow: 0px 0px 45px rgba(0,0,0,0.4); box-shadow: 0px 0px 45px rgba(0,0,0,0.4);
z-index: 10; z-index: 2100;
border-radius: 3px; border-radius: 3px;
} }
......
...@@ -31,12 +31,27 @@ angular.module("ulakbus.messaging") ...@@ -31,12 +31,27 @@ angular.module("ulakbus.messaging")
scope: {}, scope: {},
link: function(iScope, iElem, iAttrs){ link: function(iScope, iElem, iAttrs){
iScope.chatAppIsHidden = true; iScope.chatAppIsHidden = true;
// track if user is logged in
// reset state when user log in/log out
$rootScope.$watch('loggedInUser', function(v){
iScope.loggedIn = v;
reset();
});
// shared object to populate models through scopes // shared object to populate models through scopes
iScope.shared = {}; iScope.shared = {};
var popupRootElement = $(iElem).find('.popup-placeholder'); var popupRootElement = $(iElem).find('.popup-placeholder');
function reset(){
iScope.selectedChannel = null;
iScope.publicChannels = [];
iScope.notificationsChannel = [];
iScope.directChannels = [];
}
function editChannelPopup(channel){ function editChannelPopup(channel){
return MessagingPopup.show({ return MessagingPopup.show({
templateUrl: "components/messaging/templates/create_channel.html", templateUrl: "components/messaging/templates/create_channel.html",
...@@ -308,10 +323,7 @@ angular.module("ulakbus.messaging") ...@@ -308,10 +323,7 @@ angular.module("ulakbus.messaging")
$rootScope.$on("user_ready", function(){ $rootScope.$on("user_ready", function(){
// init service after user logged in // init service after user logged in
iScope.selectedChannel = null; reset();
iScope.publicChannels = [];
iScope.notificationsChannel = [];
iScope.directChannels = []
iScope.hideApp(); iScope.hideApp();
}); });
} }
......
<div> <div ng-show="loggedIn">
<a class="chat-app-button" ng-show="chatAppIsHidden" ng-click="showApp()"><i class="glyphicon glyphicon-comment"></i></a> <a class="chat-app-button" ng-show="chatAppIsHidden" ng-click="showApp()"><i class="glyphicon glyphicon-comment"></i></a>
<div class="chat-app" ng-hide="chatAppIsHidden"> <div class="chat-app" ng-hide="chatAppIsHidden">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment