Skip to content

Commit

Permalink
local playground website: smallest diff that probably fixes config bo…
Browse files Browse the repository at this point in the history
…x filenameing
  • Loading branch information
joe-kimmel-vmw committed Aug 22, 2022
1 parent 6ee7c51 commit 83a1687
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/website/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@

function NewTemplates(parentEl, templatesOpts) {
var fileObjects = [];
var configBoxesCount = 0;

function resetFiles() {
fileObjects = []
fileObjects = [];
configBoxesCount = 0;
$(".config-boxes", parentEl).empty();
}

function addFile(e, opts) { // opts = {text, name, focus}
var configId = "config-box-"+fileObjects.length;
var configId = "config-box-"+configBoxesCount;

if (!opts.name) {
opts.name = "config-" + (fileObjects.length+1) + ".yml";
opts.name = "config-" + (configBoxesCount+1) + ".yml";
}

if (!opts.text) { opts.text = ""; }
Expand Down Expand Up @@ -63,6 +65,7 @@ function NewTemplates(parentEl, templatesOpts) {
});

fileObjects.push(file);
configBoxesCount++

if (opts.focus) {
file.data.focus();
Expand Down

0 comments on commit 83a1687

Please sign in to comment.