Skip to content

Commit

Permalink
store largeChat state in main ctrl, close #20
Browse files Browse the repository at this point in the history
  • Loading branch information
kraiz committed Apr 27, 2015
1 parent a6ba347 commit b854ac8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
5 changes: 4 additions & 1 deletion app/js/controllers/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
'use strict';

EiskaltApp.controller('MainCtrl', function ($scope, $location, $interval, settings, EiskaltRPC, UpdateCheck) {
$scope.navbarCollapsed = true;
$scope.ui = {
largeChat: false,
navbarCollapsed: true
};
$scope.ratio = {
bandwidth_up: 0,
bandwidth_down: 0
Expand Down
14 changes: 7 additions & 7 deletions app/partials/hubs.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
</alert>
<div class="row" ng-show="hub.connected">
<!-- User List -->
<ul class="user-list list-group col-sm-3 col-sm-push-9" ng-hide="largeChat">
<ul class="user-list list-group col-sm-3 col-sm-push-9" ng-hide="ui.largeChat">
<li ng-repeat="user in users | orderBy:'NickOrder' " class="list-group-item" ng-controller="UserCtrl"
popover-title="{{ user.Description }}"
popover="IP: {{ user.IP || 'n/a' }}, Upload: {{ user.Connection || 'n/a' }}, Client: {{ user.Tag || 'n/a' }}"
popover-trigger="mouseenter"
popover-placement="left"
ng-hide="largeChat">
ng-hide="ui.largeChat">
<span class="nick" style="color: {{ user.Nick | stringToColor }}">{{ user.Nick }}</span>
<button class="btn btn-primary btn-xs pull-right" type="button"
title="Download {{ user.Nick }}'s filelist"
Expand All @@ -34,23 +34,23 @@
<li class="list-group-item">
<button class="btn btn-danger btn-xs" type="button" title="Disconnect from this hub"
ng-click="disconnect(hub.huburl)"
ng-hide="largeChat">
ng-hide="ui.largeChat">
<span class="glyphicon glyphicon-log-out"></span>
Disconnect
</button>
<button class="btn btn-default btn-xs pull-right" type="button" title="Enlarge chat"
ng-click="largeChat = !largeChat">
ng-click="ui.largeChat = !ui.largeChat">
<span class="hidden-sm">Enlarge chat</span>
<span class="glyphicon glyphicon-triangle-right"></span>
</button>
</li>
</ul>
<div ng-class="largeChat ? 'col-sm-12' : 'col-sm-9 col-sm-pull-3'">
<div ng-class="ui.largeChat ? 'col-sm-12' : 'col-sm-9 col-sm-pull-3'">
<!-- Chat Log -->
<div class="row">
<div class="fix-top-right" ng-show="largeChat">
<div class="fix-top-right" ng-show="ui.largeChat">
<button class="btn btn-default btn-xs" title="Show user list"
ng-click="largeChat = !largeChat">
ng-click="ui.largeChat = !ui.largeChat">
<span class="glyphicon glyphicon-triangle-left"></span>
</button>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/partials/navbar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" ng-click="navbarCollapsed = !navbarCollapsed">
<button type="button" class="navbar-toggle" ng-click="ui.navbarCollapsed = !ui.navbarCollapsed">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
Expand All @@ -11,8 +11,8 @@
</a>
</div>

<div class="navbar-collapse" collapse="navbarCollapsed">
<ul class="nav navbar-nav" ng-click="navbarCollapsed = true">
<div class="navbar-collapse" collapse="ui.navbarCollapsed">
<ul class="nav navbar-nav" ng-click="ui.navbarCollapsed = true">
<li ng-class="{active:isActive('/hubs')}">
<a href="#/hubs">
<span class="glyphicon glyphicon-home"></span>
Expand Down

0 comments on commit b854ac8

Please sign in to comment.