rename absolute prop to snap
This commit is contained in:
parent
7af3d1b120
commit
df1c2d26f4
6 changed files with 32 additions and 32 deletions
|
|
@ -24,7 +24,7 @@ module.exports.options = {
|
|||
|
||||
separator2:'behaviour',
|
||||
|
||||
absolute:false,
|
||||
snap:false,
|
||||
|
||||
separator3:'osc',
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ module.exports.create = function(widgetData,container) {
|
|||
input = widget.find('.input').fakeInput({align:'center'}),
|
||||
unit = widgetData.unit?' '+widgetData.unit.trim(): '',
|
||||
dimension = widgetData.horizontal?'width':'height',
|
||||
absolute = widgetData.absolute,
|
||||
snap = widgetData.snap,
|
||||
logScale = widgetData.logScale,
|
||||
roundFactor = Math.pow(10,widgetData.precision)
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ module.exports.create = function(widgetData,container) {
|
|||
rangeLabels.push(label)
|
||||
}
|
||||
|
||||
if (!widget.noPip) {
|
||||
if (!widget.noPip) {
|
||||
var pipTexts = {}
|
||||
for (k in rangeKeys) {
|
||||
pipTexts[rangeKeys[k]]=rangeLabels[k]
|
||||
|
|
@ -170,7 +170,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var off = 0
|
||||
wrapper.on('draginit',function(e,data){
|
||||
if (absolute || TRAVERSING) {
|
||||
if (snap || TRAVERSING) {
|
||||
var d = (dimension=='height')?
|
||||
((fader.size-data.offsetY+(wrapper.size-fader.size)/2) * 100 / fader.size):
|
||||
(data.offsetX - (wrapper.size-fader.size)/2) * 100 / fader.size
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ module.exports.options = {
|
|||
|
||||
separator2:'behaviour',
|
||||
|
||||
absolute:false,
|
||||
snap:false,
|
||||
|
||||
separator3:'osc',
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ module.exports.create = function(widgetData,container) {
|
|||
input = widget.find('.input').fakeInput({align:'center'}),
|
||||
range = widgetData.range,
|
||||
unit = widgetData.unit?' '+widgetData.unit.trim(): '',
|
||||
absolute = widgetData.absolute,
|
||||
snap = widgetData.snap,
|
||||
logScale = widgetData.logScale,
|
||||
roundFactor = Math.pow(10,widgetData.precision)
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ module.exports.create = function(widgetData,container) {
|
|||
offY = 0
|
||||
wrapper.on('draginit',function(e,data){
|
||||
|
||||
if (absolute || TRAVERSING) {
|
||||
if (snap || TRAVERSING) {
|
||||
var w = data.target.clientWidth,
|
||||
h = data.target.clientHeight,
|
||||
x = data.offsetX-w/2,
|
||||
|
|
@ -172,7 +172,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var r = clip(-data.deltaY*2+offR,[0,270])
|
||||
|
||||
if (absolute || data.ctrlKey || data.shiftKey) {
|
||||
if (snap || data.ctrlKey || data.shiftKey) {
|
||||
var w = data.target.clientWidth,
|
||||
h = data.target.clientHeight,
|
||||
x = data.deltaX + offX,
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ module.exports.create = function(widgetData,container) {
|
|||
id: widgetData.id + '#' + i,
|
||||
label:i,
|
||||
horizontal:false,
|
||||
absolute:true,
|
||||
snap:true,
|
||||
range:widgetData.range,
|
||||
logScale:widgetData.logScale,
|
||||
precision:widgetData.precision,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ module.exports.options = {
|
|||
|
||||
separator2:'behaviour',
|
||||
|
||||
absolute:false,
|
||||
snap:false,
|
||||
|
||||
separator3:'osc',
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ module.exports.create = function(widgetData,container) {
|
|||
huePad = widget.find('.hue'),
|
||||
rgbBg = pad.find('.bg')[0],
|
||||
value = {r:widget.find('.r').fakeInput({align:'center'}),g:widget.find('.g').fakeInput({align:'center'}),b:widget.find('.b').fakeInput({align:'center'})},
|
||||
absolute = widgetData.absolute,
|
||||
snap = widgetData.snap,
|
||||
split = widgetData.split?
|
||||
typeof widgetData.split == 'object'?
|
||||
widgetData.split:{r:widgetData.path+'/r',g:widgetData.path+'/g',b:widgetData.path+'/b'}
|
||||
|
|
@ -81,7 +81,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var rgbOff = {x:0,y:0}
|
||||
pad.on('draginit',function(e,data){
|
||||
if (absolute || TRAVERSING) {
|
||||
if (snap || TRAVERSING) {
|
||||
var h = ((pad.height-data.offsetY) * 100 / pad.height),
|
||||
w = (data.offsetX * 100 / pad.width)
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var hueOff = 0
|
||||
huePad.on('draginit',function(e,data){
|
||||
if (absolute || data.ctrlKey || data.shiftKey) {
|
||||
if (snap || data.ctrlKey || data.shiftKey) {
|
||||
var d = (data.offsetX * 100 / pad.width)
|
||||
hueHandle[0].setAttribute('style',`transform:translate3d(${pad.width*d/100}px,0,0)`)
|
||||
hueHandle.width = d
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ module.exports.options = {
|
|||
|
||||
separator2:'behaviour',
|
||||
|
||||
absolute:false,
|
||||
snap:false,
|
||||
|
||||
separator3:'osc',
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ module.exports.create = function(widgetData,container) {
|
|||
pad = widget.find('.xy'),
|
||||
value = {x:widget.find('.x').fakeInput({align:'center'}),y:widget.find('.y').fakeInput({align:'center'})},
|
||||
range = {x:widgetData.rangeX,y:widgetData.rangeY},
|
||||
absolute = widgetData.absolute,
|
||||
snap = widgetData.snap,
|
||||
split = widgetData.split?
|
||||
typeof widgetData.split == 'object'?
|
||||
widgetData.split:{x:widgetData.path+'/x',y:widgetData.path+'/y'}
|
||||
|
|
@ -80,7 +80,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var off = {x:0,y:0}
|
||||
pad.on('draginit',function(e,data){
|
||||
if (absolute || TRAVERSING) {
|
||||
if (snap || TRAVERSING) {
|
||||
var h = ((pad.height-data.offsetY) * 100 / pad.height),
|
||||
w = (data.offsetX * 100 / pad.width)
|
||||
|
||||
|
|
|
|||
|
|
@ -1723,7 +1723,7 @@ module.exports.options = {
|
|||
|
||||
separator2:'behaviour',
|
||||
|
||||
absolute:false,
|
||||
snap:false,
|
||||
|
||||
separator3:'osc',
|
||||
|
||||
|
|
@ -1756,7 +1756,7 @@ module.exports.create = function(widgetData,container) {
|
|||
input = widget.find('.input').fakeInput({align:'center'}),
|
||||
unit = widgetData.unit?' '+widgetData.unit.trim(): '',
|
||||
dimension = widgetData.horizontal?'width':'height',
|
||||
absolute = widgetData.absolute,
|
||||
snap = widgetData.snap,
|
||||
logScale = widgetData.logScale,
|
||||
roundFactor = Math.pow(10,widgetData.precision)
|
||||
|
||||
|
|
@ -1810,7 +1810,7 @@ module.exports.create = function(widgetData,container) {
|
|||
rangeLabels.push(label)
|
||||
}
|
||||
|
||||
if (!widget.noPip) {
|
||||
if (!widget.noPip) {
|
||||
var pipTexts = {}
|
||||
for (k in rangeKeys) {
|
||||
pipTexts[rangeKeys[k]]=rangeLabels[k]
|
||||
|
|
@ -1869,7 +1869,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var off = 0
|
||||
wrapper.on('draginit',function(e,data){
|
||||
if (absolute || TRAVERSING) {
|
||||
if (snap || TRAVERSING) {
|
||||
var d = (dimension=='height')?
|
||||
((fader.size-data.offsetY+(wrapper.size-fader.size)/2) * 100 / fader.size):
|
||||
(data.offsetX - (wrapper.size-fader.size)/2) * 100 / fader.size
|
||||
|
|
@ -2012,7 +2012,7 @@ module.exports.options = {
|
|||
|
||||
separator2:'behaviour',
|
||||
|
||||
absolute:false,
|
||||
snap:false,
|
||||
|
||||
separator3:'osc',
|
||||
|
||||
|
|
@ -2047,7 +2047,7 @@ module.exports.create = function(widgetData,container) {
|
|||
input = widget.find('.input').fakeInput({align:'center'}),
|
||||
range = widgetData.range,
|
||||
unit = widgetData.unit?' '+widgetData.unit.trim(): '',
|
||||
absolute = widgetData.absolute,
|
||||
snap = widgetData.snap,
|
||||
logScale = widgetData.logScale,
|
||||
roundFactor = Math.pow(10,widgetData.precision)
|
||||
|
||||
|
|
@ -2122,7 +2122,7 @@ module.exports.create = function(widgetData,container) {
|
|||
offY = 0
|
||||
wrapper.on('draginit',function(e,data){
|
||||
|
||||
if (absolute || TRAVERSING) {
|
||||
if (snap || TRAVERSING) {
|
||||
var w = data.target.clientWidth,
|
||||
h = data.target.clientHeight,
|
||||
x = data.offsetX-w/2,
|
||||
|
|
@ -2162,7 +2162,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var r = clip(-data.deltaY*2+offR,[0,270])
|
||||
|
||||
if (absolute || data.ctrlKey || data.shiftKey) {
|
||||
if (snap || data.ctrlKey || data.shiftKey) {
|
||||
var w = data.target.clientWidth,
|
||||
h = data.target.clientHeight,
|
||||
x = data.deltaX + offX,
|
||||
|
|
@ -2434,7 +2434,7 @@ module.exports.create = function(widgetData,container) {
|
|||
id: widgetData.id + '#' + i,
|
||||
label:i,
|
||||
horizontal:false,
|
||||
absolute:true,
|
||||
snap:true,
|
||||
range:widgetData.range,
|
||||
logScale:widgetData.logScale,
|
||||
precision:widgetData.precision,
|
||||
|
|
@ -3021,7 +3021,7 @@ module.exports.options = {
|
|||
|
||||
separator2:'behaviour',
|
||||
|
||||
absolute:false,
|
||||
snap:false,
|
||||
|
||||
separator3:'osc',
|
||||
|
||||
|
|
@ -3054,7 +3054,7 @@ module.exports.create = function(widgetData,container) {
|
|||
huePad = widget.find('.hue'),
|
||||
rgbBg = pad.find('.bg')[0],
|
||||
value = {r:widget.find('.r').fakeInput({align:'center'}),g:widget.find('.g').fakeInput({align:'center'}),b:widget.find('.b').fakeInput({align:'center'})},
|
||||
absolute = widgetData.absolute,
|
||||
snap = widgetData.snap,
|
||||
split = widgetData.split?
|
||||
typeof widgetData.split == 'object'?
|
||||
widgetData.split:{r:widgetData.path+'/r',g:widgetData.path+'/g',b:widgetData.path+'/b'}
|
||||
|
|
@ -3081,7 +3081,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var rgbOff = {x:0,y:0}
|
||||
pad.on('draginit',function(e,data){
|
||||
if (absolute || TRAVERSING) {
|
||||
if (snap || TRAVERSING) {
|
||||
var h = ((pad.height-data.offsetY) * 100 / pad.height),
|
||||
w = (data.offsetX * 100 / pad.width)
|
||||
|
||||
|
|
@ -3133,7 +3133,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var hueOff = 0
|
||||
huePad.on('draginit',function(e,data){
|
||||
if (absolute || data.ctrlKey || data.shiftKey) {
|
||||
if (snap || data.ctrlKey || data.shiftKey) {
|
||||
var d = (data.offsetX * 100 / pad.width)
|
||||
hueHandle[0].setAttribute('style',`transform:translate3d(${pad.width*d/100}px,0,0)`)
|
||||
hueHandle.width = d
|
||||
|
|
@ -3838,7 +3838,7 @@ module.exports.options = {
|
|||
|
||||
separator2:'behaviour',
|
||||
|
||||
absolute:false,
|
||||
snap:false,
|
||||
|
||||
separator3:'osc',
|
||||
|
||||
|
|
@ -3868,7 +3868,7 @@ module.exports.create = function(widgetData,container) {
|
|||
pad = widget.find('.xy'),
|
||||
value = {x:widget.find('.x').fakeInput({align:'center'}),y:widget.find('.y').fakeInput({align:'center'})},
|
||||
range = {x:widgetData.rangeX,y:widgetData.rangeY},
|
||||
absolute = widgetData.absolute,
|
||||
snap = widgetData.snap,
|
||||
split = widgetData.split?
|
||||
typeof widgetData.split == 'object'?
|
||||
widgetData.split:{x:widgetData.path+'/x',y:widgetData.path+'/y'}
|
||||
|
|
@ -3898,7 +3898,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var off = {x:0,y:0}
|
||||
pad.on('draginit',function(e,data){
|
||||
if (absolute || TRAVERSING) {
|
||||
if (snap || TRAVERSING) {
|
||||
var h = ((pad.height-data.offsetY) * 100 / pad.height),
|
||||
w = (data.offsetX * 100 / pad.width)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue