Changeset View
Changeset View
Standalone View
Standalone View
cdn/old/kGlobalAssets.js
Context not available. | |||||
18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
---|---|---|---|---|---|
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | KGlobalAssets = { | 21 | function KWidgetContentPreload(data) { | ||
22 | navigation:{}, | 22 | $.head = {}; | ||
23 | setTabContents = function (tab, html) { | 23 | $.head.content = data; | ||
24 | $('#KGlobalHeader #tab-' + tab).html(html); | 24 | } | ||
25 | }, | 25 | (function ($) { | ||
26 | loadRootNavigation: function () { | 26 | $(document).ready(function () { | ||
27 | } | 27 | var primaryTabs = ['community', 'products', 'support', 'develop', 'donate']; | ||
28 | }; | 28 | $('header').append('<style id="KGlobalHeaderHeightFix"></style>'); | ||
29 | 29 | $('html').addClass('dynamicHeightFix'); | |||
30 | 30 | $('#KGlobalStaticNavigation li').has('section').addClass('hasMenu'); | |||
31 | function KWidgetContentPreload (data) { | 31 | }); | ||
32 | $.head = {}; | 32 | $(window).load(function () { | ||
33 | KGlobalAssets.content = data; | 33 | if ($('#KSiteNavigation').hasClass('overlay')) { | ||
34 | } | 34 | $('#KGlobalHeader + *.overlay, #KGlobalHeader + * .overlay').css('padding-top', $('#KSiteNavigation').outerHeight() + 'px'); | ||
35 | 35 | } else { | |||
36 | (function( $ ) | 36 | $('#KGlobalHeaderHeightFix').text('.dynamicHeightFix { padding-top: ' + $('#KGlobalHeader').height() + 'px !important;}'); | ||
37 | { | 37 | } | ||
38 | $(document).ready(function () { | 38 | $(window).scroll(function (e) { | ||
39 | $('head').append('<link rel="stylesheet" type="text/css" href="local://widgets.css">'); | 39 | $('#KGlobalHeader').toggleClass('sticky', $(window).scrollTop() > $('#KGlobalNavigation').height()); | ||
40 | 40 | }); | |||
41 | $.ajax({ | 41 | $(window).trigger('scroll'); | ||
42 | url: "local://getContent", | 42 | $('html').addClass('animate'); | ||
43 | }) | 43 | $.ajax({ | ||
44 | .done(function( data ) { | 44 | url: '//neon.kde.org/cdn/kHeaderContent.json', | ||
45 | if ( console && console.log ) { | 45 | data: {include: 'menus'}, | ||
46 | console.log( "Sample of data:", data.slice( 0, 100 ) ); | 46 | dataType: "json", | ||
47 | } | 47 | }).success(function (e) { | ||
48 | }); | 48 | for (var section in e.menus) { | ||
49 | 49 | var el = $('#KGlobalStaticNavigation li.' + section); | |||
50 | }); | 50 | var content = $('<nav class="imported"></nav>').html(e.menus[section]); | ||
51 | })( jQuery ); | 51 | if (el.has('section').length == 0)el.addClass('hasMenu').append('<section></section>'); | ||
52 | No newline at end of file | 52 | $('section', el).prepend(content); | ||
53 | } | ||||
54 | }); | ||||
55 | }); | ||||
56 | })(jQuery); | ||||
57 | ; | ||||
Context not available. |