Fixed tour navigation in iPhone browsers

This commit is contained in:
Manuel Cillero 2017-09-11 00:01:39 +02:00
parent 7211b87ec4
commit efce8ae3ea
2 changed files with 19 additions and 11 deletions

View file

@ -1,7 +1,7 @@
$jq(function () {
// Bind to scroll.
$(window).scroll(function () {
$(window).scroll(function() {
//Display or hide scroll to top button.
if ($(this).scrollTop() > 100) {
$('#scroll-top-link').fadeIn();
@ -11,7 +11,7 @@ $jq(function () {
});
// Function for scrolling to top.
$('#scroll-top-link').click(function (e) {
$('#scroll-top-link').click(function(e) {
$("html, body").animate({
scrollTop: 0
}, 600);

View file

@ -1,15 +1,23 @@
$jq(function() {
// Destination, relative path starting with a slash.
var path = '/';
// Destination, relative path, don't start with a slash.
var path = '';
var langPath = location.pathname.replace(/^\/+/, '') + '/';
var basePath = Drupal.settings.basePath ? Drupal.settings.basePath : '';
basePath = basePath == '/' ? '' : basePath;
if (basePath.length > 0 && langPath.indexOf(basePath) == 0) {
langPath = langPath.substring(basePath.length);
var langPath = '';
var mainPath = location.pathname ? location.pathname : '/';
var basePath = Drupal.settings.basePath ? Drupal.settings.basePath : '/';
if (mainPath.indexOf(basePath) == 0) {
mainPath = mainPath.substring(basePath.length);
}
argPath = mainPath.split('/');
if (argPath[0] && argPath[0].length == 2) {
langPath = argPath[0] + '/';
argPath.shift();
}
if (path == '' && ((argPath[0] == 'user' && !argPath[1]) || (argPath[0] == 'user' && !argPath[2]))) {
path = basePath + mainPath;
} else {
path = basePath + langPath + path;
}
langPath = langPath.substring(0, langPath.indexOf('/'));
path = langPath.length == 2 ? basePath + '/' + langPath + path : basePath + path;
var prev = Drupal.t("« Prev");
var next = Drupal.t("Next »");