- removed 'stack' option for tabs, using horizontal strips does the trick

- vertical label in horizontal stripes
This commit is contained in:
jean-emmanuel 2015-09-21 10:30:18 +02:00 • committed by bordun
parent 31fe713188
commit 7571ec74f3
5 changed files with 67 additions and 40 deletions

View file

@ -46,8 +46,7 @@ A valid session file is a javascript file that returns, when eval'd, an array of
{
id:"my_tab_id", // [string] optional, default to unique 'tab_n'
label:"My tab", // [string] default to id
stack:false, // [bool] set to true to stack widgets vertically
stretch:false, // [bool] set to true to stretch widgets width
stretch:false, // [bool] set to true to stretch widgets width (don't put horizontal strips in it)
widgets: [], // [array] of widget objects
tabs: [] // [array] of tab objects
// A tab cannot contain widgets and tabs simultaneously

File diff suppressed because one or more lines are too long

View file

@ -41,7 +41,6 @@ parsetabs = function(tabs,parent,sub){
var tabContent = $('<div></div>').addClass('tab').attr('id',id);
if (tabData.stack) tabContent.addClass('stack')
if (tabData.stretch) tabContent.addClass('stretch')
if (tabData.tabs) {
@ -74,7 +73,7 @@ parsewidgets = function(widgets,parent) {
var widgetContainer = $('\
<div class="widget '+type+'-container" widgetType="'+type+'" widgetId="'+id+'" path="'+path+'" style="'+style+'">\
<div class="label">'+label+'</div>\
<div class="label"><span>'+label+'</span></div>\
</div>\
');
@ -86,6 +85,8 @@ parsewidgets = function(widgets,parent) {
widgetInner.type = type
widgetContainer.find('.label').data('papers',widgetData)
if (widgetData.class) widgetContainer.addClass(widgetData.class)
widgetContainer.append(widgetInner)
// store widget reference for cross widget sync

View file

@ -6,7 +6,10 @@ createWidget.strip = function(widgetData) {
<div class="strip">\
</div>\
');
if (widgetData.horizontal) widget.addClass('horizontal')
if (widgetData.horizontal) {
widget.addClass('horizontal')
widgetData.class = 'horizontal-container'
}
parsewidgets(widgetData.widgets,widget)
widget.getValue = function(){return}
widget.setValue = function(){return}

View file

@ -402,29 +402,13 @@ a {
bottom:0;
background:$color-fg;
.tab {
//height:100%;
font-size:0;
//position:relative;
overflow: auto;
}
.content {
// border-top:1px solid $color-border;
top:$nav-height;
}
}
.tab {
display:none;
&.on {
display: block;
height:100%;
width:auto;
}
}
#loading {
position: absolute;
@ -544,7 +528,26 @@ form {
// TABS
.tab.on.stretch {
display:flex;
justify-content: space-between;
> .widget {
width:100%;
}
}
.tab {
display:none;
overflow: auto;
&.on {
display: block;
height:100%;
width:auto;
}
}
@ -557,7 +560,7 @@ form {
overflow: hidden;
position:relative;
font-size:13rem;
padding:35rem 1px 0;
padding:35rem 0 0;
vertical-align:top;
border: 6rem solid $color-fg;
border-width:6rem 0;
@ -611,25 +614,8 @@ form {
}
}
.tab.on.stack {
display: flex;
flex-direction: column;
> .widget {
width: auto;
height:auto;
flex-shrink: 0;
margin-left:6rem;
}
}
.tab.on.stretch {
display:flex;
justify-content: space-between;
> .widget {
width:100%;
}
}
/* STRIP (contains any widgets) */
@ -672,9 +658,13 @@ form {
> .widget {
border-bottom-width: 0;
border-top-width: 0;
border-right-width:6rem;
width:auto;
flex-shrink: initial;
&:last-child {
border-right-width: 6rem;
}
}
}
height: 100%;
@ -691,6 +681,40 @@ form {
}
}
&.horizontal-container {
padding-top:0;
padding-left: 40rem;
width:100%;
height:auto;
margin:0;
border-left-width: 6rem;
display: block;
&:last-child {
margin-bottom:6rem;
}
&.nolabel {
padding-left: 0;
}
> .label {
width:35rem;
height:100%;
left:0;
top:0;
span {
transform: rotate(180deg);
display: block;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
-webkit-writing-mode:vertical-lr;
text-align: center;
height:100%;
}
}
}
}