Skip to content

Commit

Permalink
fix() a javascript mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
batiste committed Sep 1, 2016
1 parent 0efbcb5 commit 529ce06
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pages/static/pages/javascript/pages_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ $(function() {
});

// Set the publication status
var select = $('#id_status');
var opt = ({ 0: 'draft', 1: 'published', 2: 'expired', 3: 'hidden' })[select.val()];
var img = $('<img src="'+static_url+'pages/images/icons/'+opt+'.gif" alt="'+opt+'" />').insertAfter(select);
var status_select = $('#id_status');
var opt = ({ 0: 'draft', 1: 'published', 2: 'expired', 3: 'hidden' })[status_select.val()];
var img = $('<img src="'+static_url+'pages/images/icons/'+opt+'.gif" alt="'+opt+'" />').insertAfter(status_select);
// disable ajax post if page not already created (add view)
var change_status = (typeof(add_form) !== 'undefined' && add_form) ? 0 : 1;

select.change(function(e) {
pages.update_published_icon('', select, img, change_status);
status_select.change(function(e) {
pages.update_published_icon('', status_select, img, change_status);
});

var comfirm_msg = gettext('You may lose any changes you have done to the page. Are you sure?');

// Confirm template change if page is not saved
var select = $('#id_template');
if (select.length) {
var orig_ = select.val();
select.change(function() {
var template_select = $('#id_template');
if (template_select.length) {
var orig_ = template_select.val();
template_select.change(function() {
if(confirm(comfirm_msg)) {
$('input[name=_continue]').click();
} else {
select.se
//template_select
}
});
};
Expand Down

0 comments on commit 529ce06

Please sign in to comment.