Less crap in data attributes
This commit is contained in:
Родитель
06750e5541
Коммит
d00e659a5c
|
@ -1,11 +1,12 @@
|
|||
(function() {
|
||||
|
||||
define('state', [], function() {
|
||||
var locale_list = z.body.data('locales').split(',');
|
||||
var sideEffects = {
|
||||
'language': function() {
|
||||
// Upon refocus, if `navigator.language` has changed, then let's
|
||||
// refresh the page to reset our cookies and get new localized content.
|
||||
if (navigator.language.toLowerCase() in z.body.data('locales')) {
|
||||
if (_.contains(locale_list, navigator.language.toLowerCase())) {
|
||||
// TODO: If lang in querystring, then remove.
|
||||
// TODO: Prompt with confirmation before reload.
|
||||
window.location.reload();
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
data-collect-timings="{{ url('mkt.timing.record') }}:{{ collect_timings_percent }}"
|
||||
data-simulate-nav-pay="{{ settings.SIMULATE_NAV_PAY|json }}"
|
||||
data-page-type="{{ pagetype or 'leaf' }}"
|
||||
data-locales="{{ settings.LANGUAGE_URL_MAP|json }}"
|
||||
data-locales="{{ ','.join(settings.LANGUAGE_URL_MAP.keys()) }}"
|
||||
{% if not logged %}data-recaptcha="{{ settings.RECAPTCHA_PUBLIC_KEY }}"{% endif %}
|
||||
{% block bodyattrs %}{% endblock %}>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче