Просмотр исходного кода

Show 'no messages' state in chat

James Allen 12 лет назад
Родитель
Сommit
1cf508356c

+ 1 - 1
services/web/app/views/project/editor.jade

@@ -62,7 +62,7 @@ block content
 						include ./editor/publish-template
 						include ./editor/dropbox
 
-			.ui-layout-east(ng-if="!anonymous")
+			.ui-layout-east
 				include ./editor/chat
 
 	script(type="text/ng-template", id="genericMessageModalTemplate")

+ 8 - 1
services/web/app/views/project/editor/chat.jade

@@ -1,5 +1,6 @@
 aside.chat(
-	ng-controller="ChatController"
+	ng-controller="ChatController",
+	ng-if="!anonymous"
 )
 	.messages(
 		infinite-scroll="loadMoreMessages()"
@@ -12,6 +13,12 @@ aside.chat(
 			.loading(ng-show="chat.loading")
 				i.fa.fa-fw.fa-spin.fa-refresh
 				|   Loading...
+			.no-messages.text-center.small(ng-show='!chat.loading && chat.messages.length == 0')
+				| No messages
+			.first-message.text-center(ng-show='!chat.loading && chat.messages.length == 0')
+				| Send your first message
+				br
+				i.fa.fa-arrow-down
 			ul.list-unstyled(
 				ng-click="resetUnreadMessages()"
 			)

+ 11 - 0
services/web/public/stylesheets/app/editor/chat.less

@@ -7,6 +7,17 @@
 		text-align: center;
 	}
 	
+	.no-messages {
+		padding: @line-height-computed / 2;
+	}
+	
+	.first-message {
+		position: absolute;
+		bottom: 0;
+		width: 100%;
+		padding: @line-height-computed / 2;
+	}
+	
 	.messages {
 		position: absolute;
 		top: 0;