Skip to content

Commit

Permalink
Change "Done" button to say "Cancel" until a thing is saved
Browse files Browse the repository at this point in the history
Fix #1364
  • Loading branch information
hobinjk committed Oct 2, 2018
1 parent ce75716 commit df2d06d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions static/js/add-thing.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ const AddThingScreen = {
}
});

this.cancelButton.textContent = 'Cancel';

this.element.classList.remove('hidden');
this.newThingsElement.innerHTML = '';
this.visibleThings.clear();
Expand Down
5 changes: 5 additions & 0 deletions static/js/new-thing.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ class NewThing {
return response.json();
}).then(() => {
this.saveButton.innerHTML = 'Saved';

const cancelButton = document.getElementById('add-thing-cancel-button');
if (cancelButton) {
cancelButton.textContent = 'Done';
}
}).catch((error) => {
console.error(`Failed to save thing ${error}`);
this.label.innerText = 'Failed to save.';
Expand Down

0 comments on commit df2d06d

Please sign in to comment.