input: rename prop horizontal to vertical

This commit is contained in:
jean-emmanuel 2017-12-21 13:10:03 +01:00
parent 0472bb2c28
commit 492b117f49
6 changed files with 25 additions and 24 deletions

View file

@ -26,7 +26,7 @@ module.exports = class Input extends _canvas_base {
_input:'input',
horizontal:false,
vertical:false,
unit: '',
widgetId:'',
editable:true,
@ -55,8 +55,8 @@ module.exports = class Input extends _canvas_base {
this.value = ''
this.stringValue = ''
if (this.getProp('horizontal')) {
this.widget.addClass('horizontal')
if (this.getProp('vertical')) {
this.widget.addClass('vertical')
}
if (this.getProp('editable')) {
@ -132,7 +132,7 @@ module.exports = class Input extends _canvas_base {
super.resizeHandle(...arguments)
if (this.getProp('horizontal')){
if (this.getProp('vertical')){
this.ctx.setTransform(1, 0, 0, 1, 0, 0)
this.ctx.rotate(-Math.PI/2)
this.ctx.translate(-this.height, 0)
@ -177,8 +177,8 @@ module.exports = class Input extends _canvas_base {
draw() {
var v = this.stringValue,
width = this.getProp('horizontal') ? this.height : this.width,
height = !this.getProp('horizontal') ? this.height : this.width
width = this.getProp('vertical') ? this.height : this.width,
height = !this.getProp('vertical') ? this.height : this.width
if (this.getProp('unit') && v.length) v += ' ' + this.getProp('unit')

View file

@ -75,7 +75,7 @@ module.exports = class _sliders_base extends _canvas_base {
...Input.defaults(),
precision:this.getProp('precision'),
unit:this.getProp('unit'),
horizontal: this.getProp('type') == 'fader' && this.getProp('compact') && !this.getProp('horizontal')
vertical: this.getProp('type') == 'fader' && this.getProp('compact') && !this.getProp('horizontal')
},
parent:this, parentNode:this.widget
})

View file

@ -183,7 +183,7 @@ module.exports = class Range extends _widgets_base {
props:{...Input.defaults(),
precision:this.getProp('precision'),
unit:this.getProp('unit'),
horizontal: this.getProp('compact') && !this.getProp('horizontal')
vertical: this.getProp('compact') && !this.getProp('horizontal')
},
parent:this, parentNode:this.widget,
})

View file

@ -2,7 +2,7 @@
width: 100rem;
height: 60rem;
padding:1rem;
.horizontal {
.vertical {
input {
transform: rotate(-90deg);
vertical-align: middle;