Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX Monitoring form for locale changes in CMSMain.Translatable.js

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92662 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 371abfdd1d4bc459b70b9eee8e9189929ccf8dd2 1 parent b904136
@chillu chillu authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 javascript/CMSMain.Translatable.js
View
12 javascript/CMSMain.Translatable.js
@@ -8,12 +8,20 @@
return/** @lends ss.CMSMain.LangSelector */{
onmatch: function() {
var self = this;
+
+ // monitor form loading for any locale changes
+ $('#Form_EditForm').bind('loadnewpage', function(e) {
+ var newLocale = $(this).find(':input[name=Locale]').val();
+ if(newLocale) self.val(newLocale);
+ });
+
+ // whenever a new value is selected, reload the whole CMS in the new locale
this.bind('change', function(e) {
document.location = 'admin/?locale=' + $(e.target).val();
return false;
});
}
- }
+ };
});
/**
@@ -44,7 +52,7 @@
return false;
});
}
- }
+ };
});
}(jQuery));
Please sign in to comment.
Something went wrong with that request. Please try again.