- multifader made compatible with plot
- debug line removed
This commit is contained in:
parent
2262bda873
commit
c7ed97e282
5 changed files with 65 additions and 3 deletions
File diff suppressed because one or more lines are too long
|
|
@ -76,7 +76,6 @@ var editObject = function(container, data, refresh){
|
|||
} catch(err) {
|
||||
v = $(this).val()
|
||||
}
|
||||
console.log(v)
|
||||
|
||||
data[$(this).attr('title')] = v
|
||||
if (v=='') delete data[$(this).attr('title')]
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ module.exports.create = function(widgetData,container) {
|
|||
`),
|
||||
$document = $(document)
|
||||
|
||||
widget.value = []
|
||||
|
||||
for (var i=0;i<widgetData.strips;i++) {
|
||||
var data = {
|
||||
type:'fader',
|
||||
|
|
@ -54,9 +56,23 @@ module.exports.create = function(widgetData,container) {
|
|||
element[0].classList.add('not-editable')
|
||||
element.find('.fader-wrapper').off('drag')
|
||||
|
||||
widget.value[i] = widgetData.range.min
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
widget.on('sync',function(e,id,w){
|
||||
if (id==widgetData.id) return
|
||||
widget.value[w.parent().index()] = w.getValue()
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
})
|
||||
|
||||
|
||||
widget.getValue = function(){
|
||||
return widget.value
|
||||
}
|
||||
|
||||
widget.delegateDrag()
|
||||
|
||||
return widget
|
||||
|
|
|
|||
|
|
@ -1203,6 +1203,7 @@ a {
|
|||
height:100%;
|
||||
> .widget {
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
.fader-wrapper {
|
||||
padding:20rem 0!important;
|
||||
.fader {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[
|
||||
{
|
||||
"label": "Unnamed",
|
||||
"label": "Plots and ploplots",
|
||||
"widgets": [
|
||||
{
|
||||
"type": "fader",
|
||||
|
|
@ -183,5 +183,51 @@
|
|||
"label": "plot_2 (rgb)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Multifader plot !",
|
||||
"widgets": [
|
||||
{
|
||||
"type": "multifader",
|
||||
"id": "multifader_1",
|
||||
"strips": 10,
|
||||
"label": "multifader_1",
|
||||
"unit": "",
|
||||
"left": 0,
|
||||
"top": 0,
|
||||
"width": 552,
|
||||
"height": 228,
|
||||
"css": "",
|
||||
"range": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
},
|
||||
"precision": 2,
|
||||
"path": "/multifader_1",
|
||||
"target": [],
|
||||
"logScale": false
|
||||
},
|
||||
{
|
||||
"type": "plot",
|
||||
"id": "plot_3",
|
||||
"label": "plot (multifader)",
|
||||
"left": 0,
|
||||
"top": 228,
|
||||
"width": 552,
|
||||
"height": 220,
|
||||
"css": "",
|
||||
"points": "multifader_1",
|
||||
"rangeX": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
},
|
||||
"rangeY": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
},
|
||||
"logScaleX": false,
|
||||
"logScaleY": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue