Dialog is not a pop up.
Range slider can be auto initialized only when in it is in initialized view and inside of page. Init range slider manually on dialog open.
Yes that is a dialog not popup. I edited the title.
I took a look at documentation and tried fixing it but couldn’t get it work correctly.
I want three sliders in the dialog. This is the code
$$('.open-vertical').on('click', function() {
myApp.dialog.create({
title: 'Set RGB',
content: '\
div class="block">\
div class="range-slider color-red" data-label="true">\
input id="redSlider" type="range" min="0" max="255" step="1" value="50">\
/div>\
/div>\
div class="block">\
div class="range-slider color-green" data-label="true">\
input id="greenSlider" type="range" min="0" max="255" step="1" value="50">\
/div>\
/div>\
div class="block">\
div class="range-slider color-blue" data-label="true">\
input id="blueSlider" type="range" min="0" max="255" step="1" value="50">\
/div>\
/div>\
',
buttons: [{
text: 'OK',
},
{
text: 'Cancel',
},
],
verticalButtons: true,
cssClass: 'appdialog'
}).open();
// Init range sliders
myApp.range.create({
el: '.range-slider',
inputEl: '#redSlider',
on: {
change: function() {
console.log('Range Slider value changed')
}
}
});
myApp.range.create({
el: '.range-slider',
inputEl: '#greenSlider',
on: {
change: function() {
console.log('Range Slider value changed')
}
}
});
myApp.range.create({
el: '.range-slider',
inputEl: '#blueSlider',
on: {
change: function() {
console.log('Range Slider value changed')
}
}
});
But just the last one shows up. And it doesn’t look right, at 0 it looks like below