1/** 2 * @version $Id$ 3 * @package SUN Framework 4 * @subpackage Layout Builder 5 * @author JoomlaShine Team <[email protected]> 6 * @copyright Copyright (C) 2012 JoomlaShine.com. All Rights Reserved. 7 * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html 8 * 9 * Websites: http://www.joomlashine.com 10 * Technical Support: Feedback - http://www.joomlashine.com/contact-us/get-support.html 11 */ 12var SunBlank = { 13 14 _templateParams: {}, 15 16 initOnDomReady: function() 17 { 18 // Setup event to update submenu position 19 (function($) { 20 21 var RtlMenu = false; 22 if($("body").hasClass("sunfw-direction-rtl")) 23 RtlMenu = true; 24 else { 25 RtlMenu = false; 26 } 27 28 SunFwUtils.setSubmenuPosition(RtlMenu,$); 29 30 })(jQuery); 31 32 // Check megamenu is caret 33 (function($) { 34 35 if($('.sunfw-megamenu-sub-menu ul.nav li.parent').length) { 36 37 $('.sunfw-megamenu-sub-menu ul.nav:not(.sub-menu) li.parent > a, .sunfw-megamenu-sub-menu ul.nav:not(.sub-menu) li.parent > span.nav-header').append('<span class="caret"></span>'); 38 39 } 40 41 })(jQuery); 42 43 // Fixed Menu Open Bootstrap 44 (function($) { 45 46 if($('.sunfw-megamenu-sub-menu .modulecontainer ul li.divider span').length > 0) { 47 $('.sunfw-megamenu-sub-menu .modulecontainer ul li.divider > span').append('<span class="caret"></span>'); 48 } 49 50 $('.sunfw-megamenu-sub-menu .modulecontainer ul > li.parent > span, .sunfw-menu li.dropdown-submenu a.dropdown-toggle .caret, .sunfw-menu li.megamenu a.dropdown-toggle .caret, #menu_item_menu- ul.navbar-nav > li.dropdown-submenu span.caret').on("click", function(e){ 51 $(this).toggleClass('open'); 52 $(this).parent().next('ul').toggleClass('menuShow'); 53 e.stopPropagation(); 54 e.preventDefault(); 55 }); 56 57 })(jQuery); 58 59 // Animation Menu when hover 60 (function($) { 61 var timer_out; 62 timer_out = setTimeout(function() { 63 $('.sunfwMenuSlide .dropdown-submenu, .sunfwMenuSlide .megamenu').hover( 64 function() { 65 $('.sunfw-megamenu-sub-menu, .dropdown-menu', this).stop( true, true ).slideDown('fast'); 66 }, 67 function() { 68 $('.sunfw-megamenu-sub-menu, .dropdown-menu', this).stop( true, true ).slideUp('fast'); 69 } 70 ); 71 72 $('.sunfwMenuFading .dropdown-submenu, .sunfwMenuFading .megamenu').hover( 73 function() { 74 $('.sunfw-megamenu-sub-menu, .dropdown-menu', this).stop( true, true ).fadeIn('fast'); 75 }, 76 function() { 77 $('.sunfw-megamenu-sub-menu, .dropdown-menu', this).stop( true, true ).fadeOut('fast'); 78 } 79 ); 80 }, 100); 81 82 })(jQuery); 83 84 //Scroll Top 85 (function($) { 86 if($('.sunfw-scrollup').length) { 87 $(window).scroll(function() { 88 if ($(this).scrollTop() > 500) { 89 $('.sunfw-scrollup').fadeIn(); 90 } else { 91 $('.sunfw-scrollup').fadeOut(); 92 } 93 }); 94 95 $('.sunfw-scrollup').click(function(e) { 96 e.preventDefault(); 97 $("html, body").animate({ 98 scrollTop: 0 99 }, 600); 100 return false; 101 }); 102 } 103 104 //Accirdidon SideMenu at mobile device 105 if ( jQuery(window).width() <= 979){ 106 jQuery('.menu-sidemenu li.parent > a').on('click', function(e){ 107 jQuery(this).toggleClass('active').next('ul').stop().slideToggle('medium'); 108 e.preventDefault(); 109 }); 110 } 111 112 })(jQuery); 113 114 }, 115 116 initOnLoad: function() 117 { 118 //console.log('initOnLoad'); 119 }, 120 121 stickyMenu: function (element) { 122 var header = '.sunfw-sticky'; 123 var stickyNavTop = jQuery(header).offset().top; 124 125 var stickyNav = function () { 126 127 var scrollTop = jQuery(document).scrollTop(); 128 129 if (scrollTop > stickyNavTop) { 130 131 jQuery(header).addClass('sunfw-sticky-open'); 132 133 } else { 134 135 jQuery(header).removeClass('sunfw-sticky-open'); 136 137 } 138 }; 139 140 stickyNav(); 141 142 jQuery(window).scroll(function() { 143 stickyNav(); 144 }); 145 }, 146 147 initTemplate: function(templateParams) 148 { 149 // Store template parameters 150 _templateParams = templateParams; 151 152 jQuery(document).ready(function () 153 { 154 SunBlank.initOnDomReady(); 155 }); 156 157 jQuery(window).load(function () 158 { 159 SunBlank.initOnLoad(); 160
161 // Check sticky 162 if( jQuery('.sunfw-section').hasClass('sunfw-sticky')) { 163 SunBlank.stickyMenu(); 164 } 165 166 }); 167 } 168}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.