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;
height: 98%;
overflow-y: auto;
margin-left: 145px; /* sidebar */
width: auto;
top: 35px; /* topbar */
padding-bottom: 10px;
@ -267,6 +266,9 @@ input[type=text], input[type=password], .badge {
.withnicklist {
margin-right: 100px !important; /* nicklist */
}
.withsidebar {
margin-left: 145px; /* sidebar */
}
#bufferlines .btn {
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>
</ul>
</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">
<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)">
@ -334,7 +334,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
<div class="push"></div>
</div>
<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>
</body>

View file

@ -629,16 +629,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
// Open and close panels while on mobile devices through swiping
$scope.swipeSidebar = function() {
$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() {