Skip to content

Commit

Permalink
more electron fixes with filename in gists
Browse files Browse the repository at this point in the history
  • Loading branch information
blurymind committed Jul 18, 2020
1 parent b307737 commit 15dffd9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/js/classes/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const data = {
app.tags([]);
app.updateNodeLinks();
app.workspace.warpToNodeByIdx(0);
data.lastStorageHost('LOCAL');
data.isDocumentDirty(true);
app.refreshWindowTitle();
}
Expand Down Expand Up @@ -459,7 +460,7 @@ export const data = {
promptFileNameAndFormat: function (cb, suggestions = null) {
Swal.fire({
title: '💾 Save file - enter file name',
html: `<input id="swal-input1" list="select-file-name" name="select">
html: `<input id="swal-input1" list="select-file-name" name="select" placeholder="${data.editingName()}">
<datalist class="form-control" id="select-file-name">
${suggestions && suggestions.map(suggestion => `<option value="${suggestion}" />`).join('')}
</datalist>`,
Expand Down Expand Up @@ -540,19 +541,17 @@ export const data = {
gists.get(gists.file).then(gist=>{
const gistFiles = gist.body.files;
const inputOptions = {};

Object.keys(gistFiles).forEach(key => {
inputOptions[key] = key;
});
console.log(gistFiles,inputOptions)
Swal.fire({
title: '🐙 Open file from a gist',
input: 'select',
inputOptions,
inputAttributes: {
autocomplete: 'off'
},
inputPlaceholder: data.editingName() ||'Select a file from the gist',
inputPlaceholder: 'Select a file from the gist',
showCancelButton: true,
}).then(({value}) => {
if (value) {
Expand Down

0 comments on commit 15dffd9

Please sign in to comment.