diff --git a/index.html b/index.html index baad555f6a..f0d6f8fe86 100644 --- a/index.html +++ b/index.html @@ -61,7 +61,7 @@ this repository contains the full copyright notices and license terms. -->
-
@@ -80,6 +80,13 @@ this repository contains the full copyright notices and license terms. --> jQuery('[data-toggle="offcanvas"]').click(function() { jQuery('.row-offcanvas').toggleClass('active'); }); + jQuery('#tabs').on('ready', function() { + if (jQuery(this).find('> .nav-tabs').children().length) { + jQuery('.row-offcanvas').removeClass('active'); + } else { + jQuery('.row-offcanvas').addClass('active'); + } + }); Sao.login(); }); diff --git a/offcanvas.css b/offcanvas.css index e0e5eed22f..ea413e1857 100644 --- a/offcanvas.css +++ b/offcanvas.css @@ -20,25 +20,49 @@ .row-offcanvas-right .sidebar-offcanvas { - right: -50%; /* 6 columns */ + right: calc(-50% + 7px); } .row-offcanvas-left .sidebar-offcanvas { - left: -50%; /* 6 columns */ + left: calc(-50% + 7.5px); } .row-offcanvas-right.active { - right: 50%; /* 6 columns */ + right: calc(50% + 7.5px); } .row-offcanvas-left.active { - left: 50%; /* 6 columns */ + left: calc(50% + 7.5px); } .sidebar-offcanvas { position: absolute; top: 0; - width: 50%; /* 6 columns */ + width: 50%; + } +} + +@media screen and (max-width: 479px) { + .row-offcanvas-right + .sidebar-offcanvas { + right: calc(-100% + 15px); + } + + .row-offcanvas-left + .sidebar-offcanvas { + left: calc(-100% + 15px); + } + + .row-offcanvas-right.active { + right: calc(100% + 15px); + } + + .row-offcanvas-left.active { + left: calc(100% + 15px); + } + + .sidebar-offcanvas { + width: 100%; } } diff --git a/src/sao.less b/src/sao.less index f2faad7b1d..e51dce11be 100644 --- a/src/sao.less +++ b/src/sao.less @@ -22,7 +22,7 @@ font-size: 18px; } -@media screen and (max-width: 768px) { +@media screen and (max-width: @screen-xs-max) { .tab-form, .tab-board { .navbar-nav > li { float: left; @@ -204,13 +204,13 @@ button { text-align: right; } -@media screen and (max-width: 768px) { +@media screen and (max-width: @screen-xs-max) { .dict-label { text-align: left; } } -@media screen and (max-width: 768px) { +@media screen and (max-width: @screen-xs-max) { .treeview.responsive { /* Override the width from Sao.View.resize */ width: 100% !important; diff --git a/src/tab.js b/src/tab.js index c5e241ffbe..2323a34ee7 100644 --- a/src/tab.js +++ b/src/tab.js @@ -156,6 +156,7 @@ if (next) { next.find('a').tab('show'); } + tabs.trigger('ready'); }.bind(this)); }, _close_allowed: function() { @@ -269,6 +270,7 @@ Sao.View.resize(tab.el); }); tab_link.tab('show'); + tabs.trigger('ready'); }; Sao.Tab.Form = Sao.class_(Sao.Tab, {