Skip to content

Commit

Permalink
Fix icon-reset not working and show alert to save when uploading icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Ewoutvans committed Jul 27, 2018
1 parent a8cdce1 commit 5dcfb03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/projects/settings.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h4>Description</h4>
}

<!-- Project icon -->
<div class="setting">
<div class="setting setting-icon">
<form id="form-icon" enctype="multipart/form-data">
@CSRF.formField
<div class="setting-description">
Expand Down
4 changes: 4 additions & 0 deletions public/javascripts/iconUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ $(function() {
$('#update-icon').val('true');
input.val('');
updateButton();
$('.setting-icon').prepend('<div class="alert alert-info">Don\'t forget to save changes!</div>');
}
});
});
Expand All @@ -77,13 +78,16 @@ $(function() {
$.ajax({
url: url + '/reset',
type: 'post',
cache: false,
contentType: 'application/json',
complete: function() {
reset.empty().text('Reset');
},
success: function() {
preview.css('background-image', 'url(' + url + ')');
input.val('');
updateButton();
$('.setting-icon .alert').detach();
}
});
});
Expand Down

0 comments on commit 5dcfb03

Please sign in to comment.