|
|
@ -14,6 +14,10 @@ $(function() { |
|
|
|
var currentActive; |
|
|
|
var currentActive; |
|
|
|
var topCache; |
|
|
|
var topCache; |
|
|
|
var eventListeners; |
|
|
|
var eventListeners; |
|
|
|
|
|
|
|
var platformToggle; |
|
|
|
|
|
|
|
var toggleTop; |
|
|
|
|
|
|
|
var toggleHeight; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var initialize = function () { |
|
|
|
var initialize = function () { |
|
|
|
currentActive = 0; |
|
|
|
currentActive = 0; |
|
|
@ -32,8 +36,9 @@ $(function() { |
|
|
|
pageHeight = $(document).height(); |
|
|
|
pageHeight = $(document).height(); |
|
|
|
contentPadding = parseInt($('.docs-content').css('padding-bottom')); |
|
|
|
contentPadding = parseInt($('.docs-content').css('padding-bottom')); |
|
|
|
footerHeight = $('.docs-footer').outerHeight(false); |
|
|
|
footerHeight = $('.docs-footer').outerHeight(false); |
|
|
|
|
|
|
|
platformToggle = $('.js-platform-toggle'); |
|
|
|
|
|
|
|
|
|
|
|
// Device placment
|
|
|
|
// Device placement
|
|
|
|
if (windowWidth >= 768) { |
|
|
|
if (windowWidth >= 768) { |
|
|
|
device.initialLeft = device.offset().left; |
|
|
|
device.initialLeft = device.offset().left; |
|
|
|
device.initialTop = device.initialTop || device.offset().top; |
|
|
|
device.initialTop = device.initialTop || device.offset().top; |
|
|
@ -42,6 +47,7 @@ $(function() { |
|
|
|
|
|
|
|
|
|
|
|
checkDesktopContent(); |
|
|
|
checkDesktopContent(); |
|
|
|
calculateScroll(); |
|
|
|
calculateScroll(); |
|
|
|
|
|
|
|
calculateToggle(); |
|
|
|
|
|
|
|
|
|
|
|
if (!eventListeners) addEventListeners(); |
|
|
|
if (!eventListeners) addEventListeners(); |
|
|
|
} |
|
|
|
} |
|
|
@ -94,6 +100,7 @@ $(function() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
win.on('scroll', calculateScroll); |
|
|
|
win.on('scroll', calculateScroll); |
|
|
|
|
|
|
|
win.on('scroll', calculateToggle); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var checkDesktopContent = function () { |
|
|
|
var checkDesktopContent = function () { |
|
|
@ -147,6 +154,18 @@ $(function() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Platform toggle
|
|
|
|
|
|
|
|
var calculateToggle = function () { |
|
|
|
|
|
|
|
var currentTop = win.scrollTop(); |
|
|
|
|
|
|
|
var headerHeight = $('.docs-sub-header').outerHeight(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(currentTop >= headerHeight) { |
|
|
|
|
|
|
|
platformToggle.addClass('visible'); |
|
|
|
|
|
|
|
} else if (currentTop <= headerHeight) { |
|
|
|
|
|
|
|
platformToggle.removeClass('visible'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$(window).on('load resize', initialize); |
|
|
|
$(window).on('load resize', initialize); |
|
|
|
$(window).on('load', function () { new FingerBlast('.device-content'); }); |
|
|
|
$(window).on('load', function () { new FingerBlast('.device-content'); }); |
|
|
|
}); |
|
|
|
}); |
|
|
|