Index: cdn/old/kGlobalAssets.js =================================================================== --- cdn/old/kGlobalAssets.js +++ cdn/old/kGlobalAssets.js @@ -18,34 +18,40 @@ * License along with this library. If not, see . */ - KGlobalAssets = { - navigation:{}, - setTabContents = function (tab, html) { - $('#KGlobalHeader #tab-' + tab).html(html); - }, - loadRootNavigation: function () { - } - }; - - - function KWidgetContentPreload (data) { - $.head = {}; - KGlobalAssets.content = data; - } - - (function( $ ) - { - $(document).ready(function () { - $('head').append(''); - - $.ajax({ - url: "local://getContent", - }) - .done(function( data ) { - if ( console && console.log ) { - console.log( "Sample of data:", data.slice( 0, 100 ) ); - } - }); - - }); - })( jQuery ); \ No newline at end of file +function KWidgetContentPreload(data) { + $.head = {}; + $.head.content = data; +} +(function ($) { + $(document).ready(function () { + var primaryTabs = ['community', 'products', 'support', 'develop', 'donate']; + $('header').append(''); + $('html').addClass('dynamicHeightFix'); + $('#KGlobalStaticNavigation li').has('section').addClass('hasMenu'); + }); + $(window).load(function () { + if ($('#KSiteNavigation').hasClass('overlay')) { + $('#KGlobalHeader + *.overlay, #KGlobalHeader + * .overlay').css('padding-top', $('#KSiteNavigation').outerHeight() + 'px'); + } else { + $('#KGlobalHeaderHeightFix').text('.dynamicHeightFix { padding-top: ' + $('#KGlobalHeader').height() + 'px !important;}'); + } + $(window).scroll(function (e) { + $('#KGlobalHeader').toggleClass('sticky', $(window).scrollTop() > $('#KGlobalNavigation').height()); + }); + $(window).trigger('scroll'); + $('html').addClass('animate'); + $.ajax({ + url: '//neon.kde.org/cdn/kHeaderContent.json', + data: {include: 'menus'}, + dataType: "json", + }).success(function (e) { + for (var section in e.menus) { + var el = $('#KGlobalStaticNavigation li.' + section); + var content = $('').html(e.menus[section]); + if (el.has('section').length == 0)el.addClass('hasMenu').append('
'); + $('section', el).prepend(content); + } + }); + }); +})(jQuery); +;