1/* 2 * jQuery mmenu navbar addon prev content 3 * mmenu.frebsite.nl 4 * 5 * Copyright (c) Fred Heusschen 6 */ 7 8(function( $ ) { 9 10 var _PLUGIN_ = 'mmenu', 11 _ADDON_ = 'navbars', 12 _CONTENT_ = 'prev'; 13 14 $[ _PLUGIN_ ].addons[ _ADDON_ ][ _CONTENT_ ] = function( $navbar, opts ) 15 { 16 // Get vars 17 var _c = $[ _PLUGIN_ ]._c; 18 19 20 // Add content 21 $navbar.append( '<a class="' + _c.prev + ' ' + _c.btn + '" href="#"></a>' ); 22 this.bind( 'init', 23 function( $panl ) 24 { 25 $panl.removeClass( _c.hasnavbar ); 26 } 27 ); 28 29 // Update 30 var update = function() 31 { 32 var $panl = this.$pnls.children( '.' + _c.current ); 33 34 var $node = $navbar.find( '.' + _c.prev ), 35 $orgn = $panl.find( '.' + this.conf.classNames[ _ADDON_ ].panelPrev ); 36 37 if ( !$orgn.length ) 38 { 39 $orgn = $panl.children( '.' + _c.navbar ).children( '.' + _c.prev ); 40 } 41 42 var _url = $orgn.attr( 'href' ), 43 _txt = $orgn.html(); 44 45 $node[ _url ? 'attr' : 'removeAttr' ]( 'href', _url ); 46 $node[ _url || _txt ? 'removeClass' : 'addClass' ]( _c.hidden ); 47 $node.html( _txt ); 48 }; 49 50 this.bind( 'openPanel', update ); 51 this.bind( 'init', update ); 52 }; 53 54})( jQuery );
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.