Hi,
I currently designing a new custom node. For user options I like to use the editable lists widget. All works fine. Now I like to present specific options depending on selections:
all fine when I open the config panel (hinding the unused options with display:none
And I can hide the inputs depending on the selected options:
options.each(function (i) {
var option = $(this);
var component = option.find(".node-input-option-component");
var type = option.find(".node-input-option-type");
var min = option.find(".node-input-option-min");
var max = option.find(".node-input-option-max");
debugger;
if (component.val()=="slider") {
type.show();
if (type.val()=="kelvin temperature") {
min.show();
max.show();
} else {
min.hide();
max.hide();
}
} else {
type.hide();
min.hide();
max.hide();
}
});
But I'm stuck how to do this with the labels:
I defined them like this:
$('<br>')
.css('class','node-label-option-max')
.css('display',(data.type=="kelvin temperature") ? 'inline-block' : 'none')
.appendTo(row);
$('<div><span>max</span></div>')
.css('class','node-label-option-max')
.css('display',(data.type=="kelvin temperature") ? 'inline-block' : 'none')
.css('width','35px').css('padding-left','19%').appendTo(row);
But can't "find" them:
var labelMax = option.find("node-label-option-max"); // tested # and .
labelMax.hide();
I'm a newbee in modern HTML5/jquery stuff ... Any help appreciated. It would be ideal if I can somehow tie the lable together with the input.
Chris