input: rename prop horizontal to vertical
This commit is contained in:
parent
0472bb2c28
commit
492b117f49
6 changed files with 25 additions and 24 deletions
|
|
@ -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')
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
width: 100rem;
|
||||
height: 60rem;
|
||||
padding:1rem;
|
||||
.horizontal {
|
||||
.vertical {
|
||||
input {
|
||||
transform: rotate(-90deg);
|
||||
vertical-align: middle;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue