diff --git a/CHANGELOG.md b/CHANGELOG.md index 336c1ed5..4a5506a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,11 @@ - bug fixes - widgets: circular value feedback issues - editor: `ctrl + e` not working when hitm multiple times without releasing `ctrl` - - mobile: "prevent sleep" feature not working + - mobile: "prevent sleep" feature not working - widgets - patchbay: add `in`, `out` and `both` modes to `exclusive` property + - panel: replace `verticalTabs` property with `tabsPosition` (supports 4 directions) - custom module - add optional `errorCallback` argument to`loadJSON` and `saveJSON` diff --git a/src/client/managers/session/session.js b/src/client/managers/session/session.js index cfe1de6c..17571139 100644 --- a/src/client/managers/session/session.js +++ b/src/client/managers/session/session.js @@ -318,6 +318,10 @@ var converters = [ if (data.type === 'patchbay' && data.exclusive === true) { data.exclusive = 'in' } + else if ((data.type === 'panel' || data.type === 'root') && data.verticalTabs === true) { + data.tabsPosition = 'left' + delete data.verticalTabs + } } } ] diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index 7e30ef3d..15c470f0 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -33,7 +33,7 @@ class Panel extends Container() { contain: {type: 'boolean', value: true, help:'If `layout` is `vertical` or `horizontal`, prevents children from overflowing the panel.'}, scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'}, innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'}, - verticalTabs: {type: 'boolean', value: false, help: 'Set to `true` to display for vertical tab layout'}, + tabsPosition: {type: 'string', value: 'top', choices: ['top', 'bottom', 'left', 'right'], help: 'Defines the position of the navigation bar if the panel contains tabs'}, }, value: { value: {type: 'integer|array', value: '', help: [ @@ -80,7 +80,7 @@ class Panel extends Container() { if (this.getProp('tabs') && this.getProp('tabs').length) { this.container.classList.add('contains-tabs') - this.container.classList.toggle('vertical-tabs', this.getProp('verticalTabs')) + this.container.classList.add('tabs-' + this.getProp('tabsPosition')) } else { @@ -175,7 +175,7 @@ class Panel extends Container() { this.value = -1 - this.navigation = this.widget.appendChild(html`
`) + this.navigation = this.widget.appendChild(html``) this.children = options.children || new Array(this.getProp('tabs').length) for (let i = 0; i < this.children.length; i++) { diff --git a/src/scss/widgets/containers.scss b/src/scss/widgets/containers.scss index 1e5f64e1..f48575d6 100644 --- a/src/scss/widgets/containers.scss +++ b/src/scss/widgets/containers.scss @@ -132,13 +132,18 @@ } } - &.vertical-tabs { - - > inner { - flex-direction: row; - } - + &.tabs-left > inner { + flex-direction: row; } + + &.tabs-right > inner { + flex-direction: row-reverse; + } + + &.tabs-bottom > inner { + flex-direction: column-reverse; + } + } } @@ -167,7 +172,8 @@ .tablink.editing:after { margin: 2rem 2rem 4rem; } -.vertical > .tablink.editing:after { +.tabs-left > .tablink.editing:after, +.tabs-right > .tablink.editing:after { margin: 2rem 4rem 2rem 2rem; } @@ -337,7 +343,7 @@ } } - &.vertical { + &.tabs-left, &.tabs-right { flex-direction: column; height: 100%; padding-bottom: 0;