Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions sao/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
<strong>Sorry sao does not work without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div class="body" style="display: none;">
<nav class="navbar navbar-inverse navbar-static-top" role="navigation" style="margin-bottom: 0px;">
<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed"
data-toggle="collapse" data-target="#main_navbar">
<span class="caret"></span>
</button>
<a class="navbar-brand" href="javascript:void(0)" data-toggle="offcanvas">
<a class="navbar-brand" href="javascript:void(0)" data-toggle="menu">
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
<path d="M0 0h24v24H0z" fill="none"/>
Expand Down Expand Up @@ -87,14 +87,10 @@
</div>
</div>
</nav>
<div id="main" class="container-fluid" style="padding: 0px;">
<div class="row row-offcanvas row-offcanvas-left active"
style="height: calc(100vh - 50px - 1px - 20px); margin: 0px;">
<div class="col-xs-12 col-sm-4 col-lg-3 sidebar-offcanvas" id="menu" role="navigation"
style="overflow-y: auto; height: 100%;"></div>
<div class="col-xs-12 col-sm-8 col-lg-9 main-offcanvas" style="display:flex; overflow-y: auto; height: 100%;" id="tabs" role="tabpanel">
<div id="tabcontent" class="tab-content"></div>
</div>
<div id="main">
<div id="menu" role="navigation"></div>
<div id="tabs" class="hidden-xs" role="tabpanel">
<div id="tabcontent" class="tab-content"></div>
</div>
</div>
</div>
Expand All @@ -105,17 +101,20 @@
} else {
jQuery(function() {
jQuery('.body').show();
jQuery('[data-toggle="offcanvas"]').click(function() {
jQuery('.row-offcanvas').toggleClass('active');
jQuery('[data-toggle="menu"]').click(function() {
jQuery('#menu').toggleClass('hidden');
jQuery('#tabs').toggleClass('hidden-xs');
});
jQuery('#tabs').on('ready', function() {
// MAB: I removed b08b13cb commit code in this script as it seems contradictory with what b2ck do
var mq = window.matchMedia('(max-width: 991px)');
if (mq.matches) {
if (jQuery('#tablist').children().length) {
jQuery('.row-offcanvas').removeClass('active');
jQuery('#menu').addClass('hidden');
jQuery('#tabs').removeClass('hidden-xs');
} else {
jQuery('.row-offcanvas').addClass('active');
jQuery('#menu').removeClass('hidden');
jQuery('#tabs').addClass('hidden-xs');
}
}
});
Expand Down
78 changes: 0 additions & 78 deletions sao/src/offcanvas.less

This file was deleted.

3 changes: 0 additions & 3 deletions sao/src/sao.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,6 @@ var Sao = {
Sao.i18n.set_direction = function(direction) {
Sao.i18n.rtl = (direction === 'rtl');
jQuery('html').attr('dir', direction);
jQuery('.row-offcanvas')
.removeClass('row-offcanvas-left row-offcanvas-right')
.addClass(Sao.i18n.rtl ? 'row-offcanvas-right' : 'row-offcanvas-left');
};
Sao.i18n.locale = {};

Expand Down
46 changes: 43 additions & 3 deletions sao/src/sao.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ html[theme="default"] {
user-select: none;
}

.body {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;

> .navbar {
margin-bottom: 0;
}
}

// Fix double rtl prefix
.float-rtl-grid-columns(@class, @rtl-prefix) {
.col(@index) { // initial
Expand Down Expand Up @@ -150,8 +162,20 @@ html[theme="default"] {
}
}

#main {
bottom: 0;
display: flex;
flex-direction: row;
gap: .5rem;
left: 0;
position: absolute;
right: 0;
top: 6rem;
}

#menu, #tabs {
margin-top: 5px;
display: flex;
overflow: auto;

.navbar-brand {
.title {
Expand All @@ -163,6 +187,12 @@ html[theme="default"] {
}
}

#tabs {
flex: 1;
overflow-x: hidden;
padding: 0 5px;
}

@media screen and (max-width: @screen-md-max) {
#menu, #tabs {
.navbar-brand {
Expand Down Expand Up @@ -200,19 +230,30 @@ html[theme="default"] {
}

#menu {
overflow-y: auto;
padding: 0;
background-color: @navbar-default-bg;
border-color: @panel-default-border;
border-style: solid;
border-radius: 0 @panel-border-radius @panel-border-radius 0;
border-width: 1px;
margin-top: 5px;
.treeview {
height: auto;
.cell {
user-select: none;
}
}
@media (min-width: @screen-md-min) {
resize: horizontal;
width: 35rem;
min-width: 20ch;
max-width: 100vw;
}
@media (max-width: (@screen-sm-max)) {
width: 100%;
}
}

[dir="rtl"] #menu {
border-right: none;
}
Expand Down Expand Up @@ -1345,5 +1386,4 @@ img.favorite-icon {
}

@import "input-icon";
@import "offcanvas";
@import (optional) "custom.less";
8 changes: 2 additions & 6 deletions sao/src/theme/coog/sao.less
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,9 @@ nav.toolbar.panel-heading {
// The computation of the columns width when resizing sets a width
width: 0px;
}
}

// Do not use too much space for the menu
@media (min-width: @screen-lg-min) {
.make-offcanvas(min(calc(25%), @coog-max-menu-width));
.main-offcanvas {
width: calc(100% - min(calc(25%), @coog-max-menu-width));
@media (min-width: @screen-lg-min) {
width: min(calc(25%), @coog-max-menu-width);
}
}

Expand Down