Author: david.michon
Date: Thu Jun 25 05:55:55 2009
New Revision: 587
Modified:
branches/electron/pages/media/pages/javascript/pages_form.js
Log:
fix language switch alert
Modified: branches/electron/pages/media/pages/javascript/pages_form.js
==============================================================================
--- branches/electron/pages/media/pages/javascript/pages_form.js
(original)
+++ branches/electron/pages/media/pages/javascript/pages_form.js Thu Jun
25
05:55:55 2009
@@ -51,18 +51,16 @@
});
}
- // Confirm language and template change if page is not saved
- $.each(['language', 'template'], function(i, label) {
- var select = $('#id_'+label);
- if (select.length) {
- var orig_ = select.val();
- select.change(function() {
- var query = $.query.set(label,
orig_).set('new_'+label,select.val()).toString();
- select.val(orig_);
- $('#page_form').attr('action',query);
- $('input[name=_continue]').click();
- });
- }
+ // Confirm language change if page is not saved
+ $('.language ul a').each(function(i, label) {
+ $(this).click(function() {
+ var answer = confirm(gettext('Did you save your modifications
before switching language?'));
+ if (answer) {
+ return true;
+ } else {
+ return false;
+ }
+ });
});
// Disable the page content if the page is a redirection
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---