From bbb8ea7ec2c2705979cb17cebbcdba81ddbe5d4f Mon Sep 17 00:00:00 2001 From: gitolicious Date: Tue, 28 May 2019 22:30:38 +0200 Subject: [PATCH] Renamed upload button (#563) * Renamed upload button * Renamed upload button in code --- esphome/dashboard/static/esphome.js | 10 +++++----- esphome/dashboard/templates/index.html | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/esphome/dashboard/static/esphome.js b/esphome/dashboard/static/esphome.js index ee2e35f350..e7c96ec4dd 100644 --- a/esphome/dashboard/static/esphome.js +++ b/esphome/dashboard/static/esphome.js @@ -607,9 +607,9 @@ const startAceWebsocket = () => { editor.session.setAnnotations(arr); if(arr.length) { - saveUploadButton.classList.add('disabled'); + editorUploadButton.classList.add('disabled'); } else { - saveUploadButton.classList.remove('disabled'); + editorUploadButton.classList.remove('disabled'); } aceValidationRunning = false; @@ -646,7 +646,7 @@ editor.session.setOption('tabSize', 2); editor.session.setOption('useWorker', false); const saveButton = editModalElem.querySelector(".save-button"); -const saveUploadButton = editModalElem.querySelector(".save-upload-button"); +const editorUploadButton = editModalElem.querySelector(".editor-upload-button"); const saveEditor = () => { fetch(`./edit?configuration=${activeEditorConfig}`, { credentials: "same-origin", @@ -698,14 +698,14 @@ setInterval(() => { }, 100); saveButton.addEventListener('click', saveEditor); -saveUploadButton.addEventListener('click', saveEditor); +editorUploadButton.addEventListener('click', saveEditor); document.querySelectorAll(".action-edit").forEach((btn) => { btn.addEventListener('click', (e) => { activeEditorConfig = e.target.getAttribute('data-node'); const modalInstance = M.Modal.getInstance(editModalElem); const filenameField = editModalElem.querySelector('.filename'); - editModalElem.querySelector(".save-upload-button").setAttribute('data-node', activeEditorConfig); + editorUploadButton.setAttribute('data-node', activeEditorConfig); filenameField.innerHTML = activeEditorConfig; fetch(`./edit?configuration=${activeEditorConfig}`, {credentials: "same-origin"}) diff --git a/esphome/dashboard/templates/index.html b/esphome/dashboard/templates/index.html index bf1a88f4e0..60f3a79a02 100644 --- a/esphome/dashboard/templates/index.html +++ b/esphome/dashboard/templates/index.html @@ -440,7 +440,7 @@