Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local playground website: smallest diff that probably fixes config b… #720

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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