Changeset 108531 in spip-zone


Ignore:
Timestamp:
Jan 16, 2018, 2:12:22 PM (20 months ago)
Author:
brunobergot@…
Message:

version 0.1.8 : ne pas appliquer le js si l'élément ciblé n'est pas présent

permet d'éviter une erreur js sur les pages où la nav n'est pas présente

Location:
_plugins_/responsivenav/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/responsivenav/trunk/paquet.xml

    r108332 r108531  
    22        prefix="responsivenav"
    33        categorie="navigation"
    4         version="0.1.7"
     4        version="0.1.8"
    55        etat="test"
    66        compatibilite="[3.0.0;3.2.*]"
  • _plugins_/responsivenav/trunk/responsivenav_pipelines.php

    r99847 r108531  
    2424function responsivenav_insert_head($flux) {
    2525        $flux .="\n".'<script type="text/javascript" src="'.find_in_path('javascript/responsive-nav.js').'"></script>';
    26         $flux .="\n".'<script>/*<![CDATA[*/ ;(function($){ $(function(){ var nav = responsiveNav("'.lire_config('responsivenav/selector','#nav').'",{jsClass: "'._RESPONSIVENAV_JSCLASS.'",label: "'.lire_config('responsivenav/label','&#9776; Menu').'",insert: "'.lire_config('responsivenav/insert','before').'"' ;
     26        $flux .="\n".'<script>/*<![CDATA[*/ ;(function($){ if ($("'.lire_config('responsivenav/selector','#nav').'").length) { $(function(){ var nav = responsiveNav("'.lire_config('responsivenav/selector','#nav').'",{jsClass: "'._RESPONSIVENAV_JSCLASS.'",label: "'.lire_config('responsivenav/label','&#9776; Menu').'",insert: "'.lire_config('responsivenav/insert','before').'"' ;
    2727        if (defined('_RESPONSIVENAV_ANIMATE')) {$flux .= ',animate: '._RESPONSIVENAV_ANIMATE;}
    2828        if (defined('_RESPONSIVENAV_TRANSITION')) {$flux .= ',transition: '._RESPONSIVENAV_TRANSITION;}
     
    3232        if (defined('_RESPONSIVENAV_NAVCLASS')) {$flux .= ',navClass: "'._RESPONSIVENAV_NAVCLASS.'"';}
    3333        if (defined('_RESPONSIVENAV_NAVACTIVECLASS')) {$flux .= ',navActiveClass: "'._RESPONSIVENAV_NAVACTIVECLASS.'"';}
    34         $flux .= '}); }); })(jQuery); /*]]>*/ </script>';
     34        $flux .= '}); }); } })(jQuery); /*]]>*/ </script>';
    3535        return $flux;
    3636}
Note: See TracChangeset for help on using the changeset viewer.