Convert explode skin view action to toggle

Fix issue with file input in dialog form
This commit is contained in:
JannisX11 2021-01-23 22:49:21 +01:00
parent 7c7da8f21b
commit 7e64a11848
2 changed files with 7 additions and 9 deletions

View File

@ -166,7 +166,7 @@ function buildForm(dialog) {
if (data.type == 'folder' && !isApp) break;
var input = $(`<input class="dark_bordered half" class="focusable_input" type="text" id="${form_id}" disabled>`);
input[0].value = data.value;
input[0].value = data.value || '';
bar.append(input);
bar.addClass('form_bar_file');

View File

@ -359,14 +359,12 @@ BARS.defineActions(function() {
}
})
let exploded_view = false;
let explode_skin_model = new Action('explode_skin_model', {
icon: () => exploded_view ? 'close_fullscreen' : 'open_in_full',
let explode_skin_model = new Toggle('explode_skin_model', {
icon: () => 'open_in_full',
category: 'edit',
condition: {formats: ['skin']},
click: function () {
exploded_view = !exploded_view;
value: false,
onChange(exploded_view) {
Undo.initEdit({elements: Cube.all});
Cube.all.forEach(cube => {
let center = [
@ -385,8 +383,8 @@ BARS.defineActions(function() {
}
})
Blockbench.on('reset_project', () => {
exploded_view = false;
explode_skin_model.setIcon(explode_skin_model.icon)
explode_skin_model.value = false;
explode_skin_model.updateEnabledState();
})
})