PageSourceSearch

https://fondon.es/Servicios/cmsdipro/configuracion.nsf/plantillasr…lme_departamento-responsive_js/$file/app.js

js fondon.es collected 2026-09-27 21:56:17 UTC 5,787 bytes, 220 lines download raw bytes

1
2// @Autor "Antonio Restoy Carvajal" 2019
3// ACTIVAMOS MENÚ GENERAL AL PASAR EL RATÓN :HOVER
4
5$(document).ready(function(){
6  // var resolucion = 1186;
7   var resolucion = 973;
8   $("li.nav-item.dropdown").hover(function () {   
9       if ($(window).width() >= resolucion) {
10                $(this).toggleClass("show");
11                $(this).children(".dropdown-menu").toggleClass("show");
12     }
13             });
14 
15  // Activamos boton menu responsive
16  "use strict";
17  var toggles = document.querySelectorAll(".cmn-toggle-switch");
18  for (var i = toggles.length - 1; i >= 0; i--) {
19  var toggle = toggles[i];
20  toggleHandler(toggle);
21 };
22   
23 function toggleHandler(toggle) {
24 
25 toggle.addEventListener( "click", function(e) {
26 e.preventDefault();
27 var api = $("#menu-responsive").data( "mmenu" );  
28 ($('#menu-responsive').is(':visible') ?  this.classList.remove("active") | api.close() : this.classList.add("active") | api.open());
29 });
30 }
31 
32 
33 });
34 // Fin menu responsive
35 
36 $(function() {
37 
38 //	create a menu
39 var $menu = $('#menu-responsive').mmenu({		
40     extensions: {
41     "all":["pagedim-black","position-front"],
42     "(max-width: 400px)": ["fullscreen"],
43       },
44 
45     "navbars": [
46       {
47          "position": "top",
48          "height": 3,
49          "content": [
50             
51             "<div id='cab-dipalme-responsive' class='fondo-dipalme'> <a href='http://www.dipalme.org' title='Diputación de Almería'><img src='/Servicios/cmsdipro/configuracion.nsf/plantillasref/DPfamilia_departamento-responsive_img/$file/logo-res.png' alt='Logo Diputación Provincial de Almería'></a></div>"
52             
53          ]
54       },
55	    {
56          "position": "top"		  
57          
58       }
59       
60     
61    ],
62 
63 navbar:{
64  "add":true,
65  "title":"MENÚ DIPUTACIÓN" 
66 },
67 
68 // configuration
69 offCanvas: {
70   pageNodetype: "section1",
71   pageSelector: "#menu-responsive"
72 }
73 });
74 
75 
76 //   With the hooks option
77 $menu.mmenu({
78    hooks: {
79       "openPanel:start": function( $panel ) {
80         // console.log( "This panel is now opening: #" + $panel.attr( "id" ) );
81       },
82       "openPanel:finish": function( $panel ) {
83          //console.log( "This panel is now opened: #" + $panel.attr( "id" ) );
84       }
85    }
86 });
87 //	fire the plugin
88 // $('.mh-head').mhead();
89 
90 var API = $("#menu-responsive").data( "mmenu" );
91 
92 // API.toggle(function(){
93 //  consoloe.log("Cambiando");
94 //});
95 
96 var $icon = $("#toggler");
97 
98 API.bind( "open:finish", function() {
99    setTimeout(function() {
100    $icon.addClass( "active" );
101    ///console.log("Cambiando1");
102 }, 50);
103 });
104 API.bind( "close:finish", function() {
105 setTimeout(function() {
106 $icon.removeClass( "active" );
107 //console.log("Cambiando2");
108 }, 50);
109 });
110 
111 API.bind( "closePanel", function( $panel ) {
112   // console.log( "PANEL ABIERTOS: #" + $panel.attr( "id" ) );
113 });
114 API.bind( "openPanel:start", function( $panel ) {
115   $submenu = $panel.attr( "id" ) ;
116   if($submenu =="mm-1"){
117     $( "a.mm-hidden" ).parents( ".mm-navbar" ).css( "padding-left", "20px" );
118   }else{
119     $( "a.mm-btn_prev" ).parents( ".mm-navbar" ).css( "padding-left", "40px" );
120   }
121    //console.log( "This panel is now opened is: #" + $panel.attr( "id" ) );
122 
123 });
124 
125 
126 API.bind('opening', function() {
127   //   $img.attr('src', 'arrows_remove.svg');
128   //console.log("Abriendo");
129 });
130 API.bind('closing', function() {
131   //console.log("Cerando");
132   //$img.attr('src', 'arrows_hamburger.svg');
133 });
134 
135 API.openPanel($("#menu-responsive"));
136 $(".menu-open").click(function() {
137   API.open();
138 
139 });
140 
141 //	for demo only
142 $('a[href^="#/"]').click(function() {
143 //alert( 'Thank you for clicking, but that\'s a demo link.' );
144 return;
145 })
146 
147 $('.abrir').click(function() {
148 var API = $("#menu-responsive").data( "mmenu" );
149 //console.log("Abriendo panel");
150 API.open(); 
151 // return;
152 })
153 });
154 
155 
156 // Menu Lateral izquierda
157 $(document).ready(function(){
158 //$('.slider').bxSlider();
159  var resolucion = 973;
160 if ($(window).width() <= resolucion) {
161       $("#menu_lateral_izquierdo").attr("data-target","#col-izq");
162       $("#col-izq").attr("class","collapse");
163     //  console.log("Entra1");
164       }
165   if ($(window).width() > resolucion) {
166      
167       $("#menu_lateral_izquierdo").removeAttr("data-target");
168       $("#col-izq").removeAttr("class");
169     //  console.log("Entra2");
170       }
171       $(window).resize(function() {
172     console.log($(this).width());
173   if ($(window).width() <= resolucion) {
174       $("#menu_lateral_izquierdo").attr("data-target","#col-izq");
175       if ($("#col-izq").hasClass("show")) {
176           $("#col-izq").attr("class","collapse show");
177       }else{
178           $("#col-izq").attr("class","collapse");
179       }
180       
181      // console.log("Entra1");
182       }
183   if ($(window).width() > resolucion) {
184      
185       $("#menu_lateral_izquierdo").removeAttr("data-target");
186       $("#col-izq").removeAttr("class");
187      // console.log("Entra2");
188       }
189   });
190 
191 });
192 
193 
194 $(document).ready(function(){
195 $( "a.mm-hidden" ).parents( ".mm-navbar" ).css( "padding-left", "20px" );
196 
197 /*****************************************/
198 // MAPA ALMERIA SELECCIÓN
199 $.get("/Servicios/cmsdipro/configuracion.nsf/plantillasref/dipalme_departamento-responsive_js/$file/mapa.html", function (data) {
200                    $("#mapa-almeria-seleccion").append(data);
201           });
202 //$( ".mm-btn.mm-btn_prev" ).parent( ".mm-navbar_has-btns" ).css( "padding-left", "40px" );
203 //.mm-navbar_has-btns>a.mm-hidden 
204 });
205 
206 
207    jQuery.browser = {};
208    (function () {
209        jQuery.browser.msie = false;
210        jQuery.browser.version = 0;
211        if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) {
212            jQuery.browser.msie = true;
213            jQuery.browser.version = RegExp.$1;
214        }
215    })();
216
217 
218 
219 
220 

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.