Fix label for randomness slider in select window

Add suggestions for texture names in select window
This commit is contained in:
JannisX11 2021-06-26 17:24:05 +02:00
parent 23419d7945
commit 224399b8a3
2 changed files with 6 additions and 5 deletions

View File

@ -53,8 +53,9 @@ function buildForm(dialog) {
bar.append(input_element)
if (data.list) {
input_element.list = `${dialog.id}_${form_id}_list`;
let list = $(`<datalist id="${input_element.list}"></datalist>`);
let list_id = `${dialog.id}_${form_id}_list`;
input_element.setAttribute('list', list_id);
let list = $(`<datalist id="${list_id}"></datalist>`);
for (let value of data.list) {
let node = document.createElement('option');
node.value = value;
@ -402,7 +403,7 @@ window.Dialog = class Dialog {
if (result === false) return;
}
if (typeof this.onButton == 'function') {
let result = this.onButton(button);
let result = this.onButton(button, event);
if (result === false) return;
}
this.hide();

View File

@ -824,12 +824,12 @@ BARS.defineActions(function() {
new: {label: 'dialog.select.new', type: 'checkbox', value: true},
group: {label: 'dialog.select.group', type: 'checkbox'},
name: {label: 'dialog.select.name', type: 'text'},
texture: {label: 'data.texture', type: 'text'},
texture: {label: 'data.texture', type: 'text', list: Texture.all.map(tex => tex.name)},
color: {label: 'menu.cube.color', type: 'select', value: '-1', options: color_options}
},
lines: [
`<div class="dialog_bar form_bar">
<label class="name_space_left tl">dialog.select.random</label>
<label class="name_space_left">${tl('dialog.select.random')}</label>
<input type="range" min="0" max="100" step="1" value="100" class="tool half" style="width: 100%;" id="selgen_random">
</div>`
],