Sha256: d561811db56644ac46db621250f1eb1958d85a0173f4c96a24740b390536467e

Contents?: true

Size: 1.83 KB

Versions: 4

Compression:

Stored size: 1.83 KB

Contents

{I"
class:ETI"BundledAsset;FI"logical_path;TI"jquery.adaptivemenu.js;FI"
pathname;TI"m/usr/local/rvm/gems/ruby-2.1.2/gems/spree_backend-2.2.4/vendor/assets/javascripts/jquery.adaptivemenu.js;FI"content_type;TI"application/javascript;TI"
mtime;Tl+TI"length;TidI"digest;TI"%58f568b3f92add192fb84f2841db3d2f;FI"source;TI"djQuery.fn.AdaptiveMenu = function(options){

	var options = jQuery.extend({
		text: "More...",
		accuracy:70,
		'class':null,
		'classLinckMore':null
	},options);

	var menu = this;
	var li = $(menu).find("li");

	// li.css({"display":"inline","white-space":"nowrap"});

	var width = 0;
	var widthLi = [];
	$.each( li , function(i, l){
		width += $(l).width();
		widthLi.push( width );
	});

	var buildingMenu = function(windowWidth){
		var windowWidth = windowWidth  - options.accuracy;
		for(var i = 0; i<widthLi.length; i++ ){
			if ( widthLi[i] > windowWidth )
				$( li[i] ).hide();
			else
				$( li[i] ).show();
		}
		$(menu).find('#more').remove();
		var hideLi = $(li).filter(':not(:visible)');
		var lastLi = $(li).filter(':visible').last();
		if ( hideLi.length > 0 ){
			var more = $("<li>")
				.css({"display":"inline-block","white-space":"nowrap"})
				.addClass(options.classLinckMore)
				.attr({"id":"more"})
				.html(options.text)
				.click(function(){$(this).find('li').toggle()});

			var ul =  $("<ul>")
				.css({"position":"absolute"})
				.addClass(options.klass)
				.html(hideLi.clone()).prepend(lastLi.clone().hide());

			more.append(ul);

			lastLi.hide().before(more);
		}
	}

	jQuery(window).resize(function() {
		buildingMenu( jQuery(window).width() );
	});

	jQuery(window).ready(function() {
		buildingMenu( jQuery(window).width() );
	});

};
;TI"required_assets_digest;TI"%1aa929c44e2dced6d1bbb2b085068a87;FI"
_version;TI"%5ef14a844324cba3e114bd0123f88a5e;F

Version data entries

4 entries across 2 versions & 1 rubygems

Version Path
bcms_spree-0.0.2 test/dummy/tmp/cache/assets/development/sprockets/097cc70b7837aaba1dec0f5b3eb7000f
bcms_spree-0.0.2 test/dummy/tmp/cache/assets/development/sprockets/0b8ceab4b839e6d6d9e43d6e2deeeb6f
bcms_spree-0.0.1 test/dummy/tmp/cache/assets/development/sprockets/097cc70b7837aaba1dec0f5b3eb7000f
bcms_spree-0.0.1 test/dummy/tmp/cache/assets/development/sprockets/0b8ceab4b839e6d6d9e43d6e2deeeb6f