Skip to content

Commit

Permalink
Merge pull request #720 from vmware-tanzu/jk-playground-fix-just-the-…
Browse files Browse the repository at this point in the history
…diff-man

local playground website:  smallest diff that probably fixes config b…
  • Loading branch information
pivotaljohn authored Aug 23, 2022
2 parents 6ee7c51 + 83a1687 commit a787f84
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 a787f84

Please sign in to comment.