mirror of
https://github.com/esphome/esphome.git
synced 2024-10-31 08:25:53 +01:00
Renamed upload button (#563)
* Renamed upload button * Renamed upload button in code
This commit is contained in:
parent
928df2dcd1
commit
bbb8ea7ec2
@ -607,9 +607,9 @@ const startAceWebsocket = () => {
|
|||||||
editor.session.setAnnotations(arr);
|
editor.session.setAnnotations(arr);
|
||||||
|
|
||||||
if(arr.length) {
|
if(arr.length) {
|
||||||
saveUploadButton.classList.add('disabled');
|
editorUploadButton.classList.add('disabled');
|
||||||
} else {
|
} else {
|
||||||
saveUploadButton.classList.remove('disabled');
|
editorUploadButton.classList.remove('disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
aceValidationRunning = false;
|
aceValidationRunning = false;
|
||||||
@ -646,7 +646,7 @@ editor.session.setOption('tabSize', 2);
|
|||||||
editor.session.setOption('useWorker', false);
|
editor.session.setOption('useWorker', false);
|
||||||
|
|
||||||
const saveButton = editModalElem.querySelector(".save-button");
|
const saveButton = editModalElem.querySelector(".save-button");
|
||||||
const saveUploadButton = editModalElem.querySelector(".save-upload-button");
|
const editorUploadButton = editModalElem.querySelector(".editor-upload-button");
|
||||||
const saveEditor = () => {
|
const saveEditor = () => {
|
||||||
fetch(`./edit?configuration=${activeEditorConfig}`, {
|
fetch(`./edit?configuration=${activeEditorConfig}`, {
|
||||||
credentials: "same-origin",
|
credentials: "same-origin",
|
||||||
@ -698,14 +698,14 @@ setInterval(() => {
|
|||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
saveButton.addEventListener('click', saveEditor);
|
saveButton.addEventListener('click', saveEditor);
|
||||||
saveUploadButton.addEventListener('click', saveEditor);
|
editorUploadButton.addEventListener('click', saveEditor);
|
||||||
|
|
||||||
document.querySelectorAll(".action-edit").forEach((btn) => {
|
document.querySelectorAll(".action-edit").forEach((btn) => {
|
||||||
btn.addEventListener('click', (e) => {
|
btn.addEventListener('click', (e) => {
|
||||||
activeEditorConfig = e.target.getAttribute('data-node');
|
activeEditorConfig = e.target.getAttribute('data-node');
|
||||||
const modalInstance = M.Modal.getInstance(editModalElem);
|
const modalInstance = M.Modal.getInstance(editModalElem);
|
||||||
const filenameField = editModalElem.querySelector('.filename');
|
const filenameField = editModalElem.querySelector('.filename');
|
||||||
editModalElem.querySelector(".save-upload-button").setAttribute('data-node', activeEditorConfig);
|
editorUploadButton.setAttribute('data-node', activeEditorConfig);
|
||||||
filenameField.innerHTML = activeEditorConfig;
|
filenameField.innerHTML = activeEditorConfig;
|
||||||
|
|
||||||
fetch(`./edit?configuration=${activeEditorConfig}`, {credentials: "same-origin"})
|
fetch(`./edit?configuration=${activeEditorConfig}`, {credentials: "same-origin"})
|
||||||
|
@ -440,7 +440,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a class="waves-effect waves-green btn-flat save-button">Save</a>
|
<a class="waves-effect waves-green btn-flat save-button">Save</a>
|
||||||
<a class="modal-close waves-effect waves-green btn-flat action-upload save-upload-button">Save & Upload</a>
|
<a class="modal-close waves-effect waves-green btn-flat action-upload editor-upload-button">Upload</a>
|
||||||
<a class="modal-close waves-effect waves-green btn-flat">Close</a>
|
<a class="modal-close waves-effect waves-green btn-flat">Close</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user