started to activate translations ajax nav
This commit is contained in:
@@ -1,2 +1,13 @@
|
||||
|
||||
void 0;if(edlp.redirect){void 0;window.localStorage.setItem('edlp_origin_path',edlp.sys_path.replace(/^\//,''));window.localStorage.setItem('edlp_origin_url',window.location.pathname);window.localStorage.setItem('edlp_origin_hash',window.location.hash);window.location.replace(window.location.origin);}else{void 0;}
|
||||
console.log('EDLP THEME HISTORY.js');
|
||||
// var edlp is provided by edlp_ajax.module file
|
||||
if(edlp.redirect){
|
||||
console.log('history redirect', edlp);
|
||||
console.log('window.location', window.location);
|
||||
window.localStorage.setItem('edlp_origin_path', edlp.sys_path.replace(/^\//, ''));
|
||||
window.localStorage.setItem('edlp_origin_url', window.location.pathname);
|
||||
window.localStorage.setItem('edlp_origin_hash', window.location.hash);
|
||||
// redirect to home
|
||||
window.location.replace(window.location.origin+'/'+edlp.lang_code);
|
||||
}else{
|
||||
console.log('history do not redirect');
|
||||
}
|
||||
|
||||
+1184
-40
File diff suppressed because it is too large
Load Diff
+2712
-1
File diff suppressed because one or more lines are too long
@@ -1,12 +1,13 @@
|
||||
console.log('EDLP THEME HISTORY.js');
|
||||
// var edlp is provided by edlp_ajax.module file
|
||||
if(edlp.redirect){
|
||||
console.log('history redirect');
|
||||
console.log('history redirect', edlp);
|
||||
console.log('window.location', window.location);
|
||||
window.localStorage.setItem('edlp_origin_path', edlp.sys_path.replace(/^\//, ''));
|
||||
window.localStorage.setItem('edlp_origin_url', window.location.pathname);
|
||||
window.localStorage.setItem('edlp_origin_hash', window.location.hash);
|
||||
// redirect to home
|
||||
window.location.replace(window.location.origin);
|
||||
window.location.replace(window.location.origin+'/'+edlp.lang_code);
|
||||
}else{
|
||||
console.log('history do not redirect');
|
||||
}
|
||||
|
||||
@@ -371,6 +371,7 @@
|
||||
|
||||
$('a.site-name', '#block-edlptheme-branding')
|
||||
.add('a', '#block-mainnavigation')
|
||||
.add('a', '.block.language-switcher-language-url')
|
||||
.add('a', '#block-footer.menu--footer')
|
||||
.add('a', '#block-productions')
|
||||
.add('a', 'article.node:not(.node--type-enregistrement) h2.node-title')
|
||||
@@ -408,6 +409,11 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
if($link.is('.language-link')){
|
||||
// TODO load all blocks translated ... :/
|
||||
// then let load the content
|
||||
}
|
||||
|
||||
// other links
|
||||
var sys_path = $(this).attr('data-drupal-link-system-path');
|
||||
|
||||
|
||||
@@ -242,3 +242,11 @@ function edlptheme_preprocess_image_formatter(&$vars){
|
||||
// dpm($vars);
|
||||
}
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_links__language_block(&$vars){
|
||||
// dpm($vars);
|
||||
foreach ($vars['links'] as $lang_code => $link) {
|
||||
$vars['links'][$lang_code]['text'] = $lang_code;
|
||||
$vars['links'][$lang_code]['link']['#title'] = $lang_code;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -43,9 +43,10 @@
|
||||
{%- endif -%}
|
||||
<ul{{ attributes }}>
|
||||
{%- for item in links -%}
|
||||
<!-- {{ dump(item) }} -->
|
||||
<li{{ item.attributes }}>
|
||||
{%- if item.link -%}
|
||||
<a href="{{ item.link.url }}">{{ item.text|slice(0,2) }}</a>
|
||||
{{ item.link }}
|
||||
{%- elseif item.text_attributes -%}
|
||||
<span{{ item.text_attributes }}>{{ item.text }}</span>
|
||||
{%- else -%}
|
||||
|
||||
Reference in New Issue
Block a user