Skip to content

Commit

Permalink
Merge pull request #106 from mahasadhu/mahasadhu-bugfix1
Browse files Browse the repository at this point in the history
bugfix page template select element on change, revert to previous value when user click cancel on confirmation box
  • Loading branch information
tabacitu authored Jan 15, 2021
2 parents 1610729 + 2aee992 commit 601b940
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@ function strip_last_template_parameter(url) {
}
jQuery(document).ready(function($) {
$('#select_template').data('current', $('#select_template').val());
$("#select_template").change(function(e) {
var select_template_confirmation = confirm("@lang('backpack::pagemanager.change_template_confirmation')");
if (select_template_confirmation == true) {
redirect_to_new_page_with_template_parameter();
} else {
// txt = "You pressed Cancel!";
$('#select_template').val($('#select_template').data('current'));
}
});
Expand All @@ -81,4 +84,4 @@ function strip_last_template_parameter(url) {

@endif
{{-- End of Extra CSS and JS --}}
{{-- ########################################## --}}
{{-- ########################################## --}}

0 comments on commit 601b940

Please sign in to comment.