Sha256: a3792da780a9735748f0f02a181006e508b914a4f102f1560c63756ad872869d

Contents?: true

Size: 1.39 KB

Versions: 28

Compression:

Stored size: 1.39 KB

Contents

(function($){

	$(document).ready(function (){
		dropdownNav.handleEvents();
	});

	var dropdownNav = {
		
		handleEvents : function(){
			$('.iasd-dropdown-navigation .dropdown-menu').on('click', dropdownNav.preventClosing);
			$('.iasd-dropdown-navigation .dropdown-toggle').on('click', dropdownNav.openMenu);
			$('.iasd-dropdown-navigation .dropdown-menu > ul > li:not(.dsa-link) > a').bind('click', dropdownNav.openSubmenu);
			$('.iasd-dropdown-navigation .back > a').bind('click', dropdownNav.closeSubmenu);		
		},
		
		preventClosing : function(e) {
			e.stopPropagation();
		},

		openMenu : function(){
			var jqThis = $('.iasd-dropdown-navigation .dropdown-menu > ul > li').find('ul.active');
			if (jqThis.size()){
				setTimeout(function(){ 
					$('.iasd-dropdown-navigation .dropdown-menu').css('height', jqThis.height()+15); //15px from padding
				}, 15);
			}
		},

		openSubmenu : function(e) {
			var jqThis = $(this);
			var submenuTarget = jqThis.closest('li').find('ul');
			submenuTarget.toggleClass('active');
			$('.iasd-dropdown-navigation .dropdown-menu').css('height', submenuTarget.height()+15); //15px from padding
			e.preventDefault();
		},

		closeSubmenu : function(e) {
			var $this = $(this);
			var submenuTarget = $this.closest('ul');
			$('.iasd-dropdown-navigation .dropdown-menu').css('height', '');
			submenuTarget.removeClass('active');
			e.preventDefault();
		}		

	};

})(jQuery);

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
iasd-bootstrap-sass-1.2.1 templates/project/lib/iasd_dropdown_nav.js
iasd-bootstrap-sass-1.2.0 templates/project/lib/iasd_dropdown_nav.js
iasd-bootstrap-sass-1.1.0 templates/project/lib/iasd_dropdown_nav.js
iasd-bootstrap-sass-1.0.5 templates/project/lib/iasd_dropdown_nav.js
iasd-bootstrap-sass-1.0.4 templates/project/lib/iasd_dropdown_nav.js
iasd-bootstrap-sass-1.0.3 templates/project/lib/iasd_dropdown_nav.js
iasd-bootstrap-sass-1.0.2 templates/project/lib/iasd_dropdown_nav.js
iasd-bootstrap-sass-1.0.1 templates/project/lib/iasd_dropdown_nav.js