Skip to content

Commit

Permalink
[Fix] Layout
Browse files Browse the repository at this point in the history
  • Loading branch information
thize committed May 22, 2020
1 parent ccc16bf commit c7a01e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/ui/components/export_buttons_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ function exportButtonsUi() {
const components = buildRadio('Components');
const fontStyles = buildRadio('FontStyles');
const switchs = artboards + components + '<br>' + colors + fontStyles;
const exportContent = title + exportSelectionButton() + exportSingleColorButton() + exportIosIconButton() + exportAndroidIconButton();
// exportSingleColorButton() +
const exportContent = title + exportSelectionButton() + exportIosIconButton() + exportAndroidIconButton();
const exportAllContent = titleAll + switchs + exportAllButton();
return exportContent + '<hr>' + exportAllContent;
}
Expand All @@ -26,7 +27,7 @@ function exportSingleColorButton() {
}

function exportIosIconButton() {
return buttonUi('iosIconButton', 'iOS Icons', false);
return buttonUi('iosIconButton', 'iOS Icon', false);
}

function exportAndroidIconButton() {
Expand Down
26 changes: 13 additions & 13 deletions src/ui/main_panel_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ function show(event) {

let oldItemsLengh;
function update() {
// const singleColorButton = document.getElementById('singleColorButton');
// const isToActiveSingleColorButton = items.length == 1 && (items[0].children.length == 0 || items[0].constructor.name == 'Artboard');
// _changeButtonState(singleColorButton, isToActiveSingleColorButton);
const items = scenegraph.selection.items;
const singleColorButton = document.getElementById('singleColorButton');
const selectionButton = document.getElementById('selectionButton');
const iosIconButton = document.getElementById('iosIconButton');
const androidIconButton = document.getElementById('androidIconButton');
const isToActiveSelectionButton = items.length > 0;
_changeButtonState(selectionButton, isToActiveSelectionButton);
const isToActiveSingleColorButton = items.length == 1 && (items[0].children.length == 0 || items[0].constructor.name == 'Artboard');
_changeButtonState(singleColorButton, isToActiveSingleColorButton);
const isToActiveIosIconButton = items.length == 1;
_changeButtonState(iosIconButton, isToActiveIosIconButton);
const isToActiveAndroidIconButton = items.length == 1;
Expand All @@ -57,10 +57,10 @@ function update() {
}

function buildTaps() {
let singleColorButton = document.getElementById('singleColorButton');
singleColorButton.onclick = _checkActive(singleColorButton, function () {
onTapExport('SingleColor');
});
// let singleColorButton = document.getElementById('singleColorButton');
// singleColorButton.onclick = _checkActive(singleColorButton, function () {
// onTapExport('SingleColor');
// });
let selectionButton = document.getElementById('selectionButton');
selectionButton.onclick = _checkActive(selectionButton, function () {
onTapExport('Selection');
Expand All @@ -70,12 +70,12 @@ function buildTaps() {
let exportAllRadio = document.querySelector('input[name="exportAllRadio"]:checked');
onTapExport(exportAllRadio.value);
});
let changeProjectFolderButton = document.getElementById('changeProjectFolderButton');
changeProjectFolderButton.onclick = async function () {
await changeProjectFolder();
const projectFolderInput = document.getElementById('projectFolderInput');
projectFolderInput.value = getFolderPath();
};
// let changeProjectFolderButton = document.getElementById('changeProjectFolderButton');
// changeProjectFolderButton.onclick = async function () {
// await changeProjectFolder();
// const projectFolderInput = document.getElementById('projectFolderInput');
// projectFolderInput.value = getFolderPath();
// };
let iosIconButton = document.getElementById('iosIconButton');
iosIconButton.onclick = function () {
exportAppIcon('ios');
Expand Down

0 comments on commit c7a01e0

Please sign in to comment.