Use CSS classes instead of javascript for margin

This commit is contained in:
Tor Hveem 2014-02-21 15:35:06 +01:00
parent 46b503e1b4
commit 056aa3deed
3 changed files with 5 additions and 13 deletions

View file

@ -256,7 +256,6 @@ input[type=text], input[type=password], .badge {
position: relative; position: relative;
height: 98%; height: 98%;
overflow-y: auto; overflow-y: auto;
margin-left: 145px; /* sidebar */
width: auto; width: auto;
top: 35px; /* topbar */ top: 35px; /* topbar */
padding-bottom: 10px; padding-bottom: 10px;
@ -267,6 +266,9 @@ input[type=text], input[type=password], .badge {
.withnicklist { .withnicklist {
margin-right: 100px !important; /* nicklist */ margin-right: 100px !important; /* nicklist */
} }
.withsidebar {
margin-left: 145px; /* sidebar */
}
#bufferlines .btn { #bufferlines .btn {
font-family: sans-serif; font-family: sans-serif;
} }

View file

@ -289,7 +289,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
</li> </li>
</ul> </ul>
</div> </div>
<div bindonce id="bufferlines" class="monospace" ng-class="{'withnicklist': showNicklist}"> <div bindonce id="bufferlines" class="monospace" ng-class="{'withnicklist': showNicklist, 'withsidebar': showSidebar}">
<div id="nicklist" ng-show="showNicklist" ng-swipe-right="closeNick()" class="vertical-line-left"> <div id="nicklist" ng-show="showNicklist" ng-swipe-right="closeNick()" class="vertical-line-left">
<ul class="nicklistgroup list-unstyled" ng-repeat="group in activeBuffer().nicklist"> <ul class="nicklistgroup list-unstyled" ng-repeat="group in activeBuffer().nicklist">
<li ng-repeat="nick in group.nicks|orderBy:'name'" ng-click="openBuffer(nick.name)"> <li ng-repeat="nick in group.nicks|orderBy:'name'" ng-click="openBuffer(nick.name)">
@ -334,7 +334,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
<div class="push"></div> <div class="push"></div>
</div> </div>
<div id="footer" ng-show="connected"> <div id="footer" ng-show="connected">
<div class="navbar navbar-inverse navbar-fixed-bottom" ng-class="{'withnicklist': showNicklist}"> <div class="navbar navbar-inverse navbar-fixed-bottom" ng-class="{'withnicklist': showNicklist, 'withsidebar': showSidebar}">
<div input-bar></div> <div input-bar></div>
</div> </div>
</body> </body>

View file

@ -629,16 +629,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
// Open and close panels while on mobile devices through swiping // Open and close panels while on mobile devices through swiping
$scope.swipeSidebar = function() { $scope.swipeSidebar = function() {
$scope.showSidebar = !$scope.showSidebar; $scope.showSidebar = !$scope.showSidebar;
// remove or add margin if big screen
if (document.body.clientWidth > mobile_cutoff) {
if($scope.showSidebar) {
$('#bufferlines').css('margin-left','145px');
$('.navbar-fixed-bottom').css('margin-left','145px');
}else{
$('#bufferlines').css('margin-left','0');
$('.navbar-fixed-bottom').css('margin-left','0');
}
}
}; };
$scope.openNick = function() { $scope.openNick = function() {