Skip to content

Commit

Permalink
Merge pull request #324 from roggervalf/fix-refresh-page
Browse files Browse the repository at this point in the history
Change add job text depending on hide prop on dashboard
  • Loading branch information
bradvogel authored Feb 18, 2021
2 parents ec5e979 + 5722b55 commit a71feb0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion public/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ $(document).ready(() => {
});

$('.js-toggle-add-job-editor').on('click', function () {
$('.jsoneditorx').toggleClass('hide');
const addJobText = $('.js-toggle-add-job-editor').text();
const shouldNotHide = addJobText === 'Add Job';
const newAddJobText = shouldNotHide ? 'Cancel' : 'Add Job';
$('.jsoneditorx').toggleClass('hide', !shouldNotHide);
$('.js-toggle-add-job-editor').text(newAddJobText);

const job = localStorage.getItem('arena:savedJob');
if (job) {
const { name, data } = JSON.parse(job);
Expand Down

0 comments on commit a71feb0

Please sign in to comment.