1/* 2 * Foundation Responsive Library 3 * http://foundation.zurb.com 4 * Copyright 2014, ZURB 5 * Free to use under the MIT license. 6 * http://www.opensource.org/licenses/mit-license.php 7*/ 8 9(function ($, window, document, undefined) { 10 'use strict'; 11 12 var header_helpers = function (class_array) { 13 var i = class_array.length; 14 var head = $('head'); 15 16 while (i--) { 17 if(head.has('.' + class_array[i]).length === 0) { 18 head.append('<meta class="' + class_array[i] + '" />'); 19 } 20 } 21 }; 22 23 header_helpers([ 24 'foundation-mq-small', 25 'foundation-mq-small-only', 26 'foundation-mq-medium', 27 'foundation-mq-medium-only', 28 'foundation-mq-large', 29 'foundation-mq-large-only', 30 'foundation-mq-xlarge', 31 'foundation-mq-xlarge-only', 32 'foundation-mq-xxlarge', 33 'foundation-data-attribute-namespace']); 34 35 // Enable FastClick if present 36 37 $(function() { 38 if (typeof FastClick !== 'undefined') { 39 // Don't attach to body if undefined 40 if (typeof document.body !== 'undefined') { 41 FastClick.attach(document.body); 42 } 43 } 44 }); 45 46 // private Fast Selector wrapper, 47 // returns jQuery object. Only use where 48 // getElementById is not available. 49 var S = function (selector, context) { 50 if (typeof selector === 'string') { 51 if (context) { 52 var cont; 53 if (context.jquery) { 54 cont = context[0]; 55 if (!cont) return context; 56 } else { 57 cont = context; 58 } 59 return $(cont.querySelectorAll(selector)); 60 } 61 62 return $(document.querySelectorAll(selector)); 63 } 64 65 return $(selector, context); 66 }; 67 68 // Namespace functions. 69 70 var attr_name = function (init) { 71 var arr = []; 72 if (!init) arr.push('data'); 73 if (this.namespace.length > 0) arr.push(this.namespace); 74 arr.push(this.name); 75 76 return arr.join('-'); 77 }; 78 79 var add_namespace = function (str) { 80 var parts = str.split('-'), 81 i = parts.length, 82 arr = []; 83 84 while (i--) { 85 if (i !== 0) { 86 arr.push(parts[i]); 87 } else { 88 if (this.namespace.length > 0) { 89 arr.push(this.namespace, parts[i]); 90 } else { 91 arr.push(parts[i]); 92 } 93 } 94 } 95 96 return arr.reverse().join('-'); 97 }; 98 99 // Event binding and data-options updating. 100 101 var bindings = function (method, options) { 102 var self = this, 103 should_bind_events = !S(this).data(this.attr_name(true)); 104 105 if (S(this.scope).is('[' + this.attr_name() +']')) { 106 S(this.scope).data(this.attr_name(true) + '-init', $.extend({}, this.settings, (options || method), this.data_options(S(this.scope)))); 107 108 if (should_bind_events) { 109 this.events(this.scope); 110 } 111 112 } else { 113 S('[' + this.attr_name() +']', this.scope).each(function () { 114 var should_bind_events = !S(this).data(self.attr_name(true) + '-init'); 115 S(this).data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options(S(this)))); 116 117 if (should_bind_events) { 118 self.events(this); 119 } 120 }); 121 } 122 // # Patch to fix #5043 to move this *after* the if/else clause in order for Backbone and similar frameworks to have improved control over event binding and data-options updating. 123 if (typeof method === 'string') { 124 return this[method].call(this, options); 125 } 126 127 }; 128 129 var single_image_loaded = function (image, callback) { 130 function loaded () { 131 callback(image[0]); 132 } 133 134 function bindLoad () { 135 this.one('load', loaded); 136 137 if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { 138 var src = this.attr( 'src' ), 139 param = src.match( /\?/ ) ? '&' : '?'; 140 141 param += 'random=' + (new Date()).getTime(); 142 this.attr('src', src + param); 143 } 144 } 145 146 if (!image.attr('src')) { 147 loaded(); 148 return; 149 } 150 151 if (image[0].complete || image[0].readyState === 4) { 152 loaded(); 153 } else { 154 bindLoad.call(image); 155 } 156 }; 157 158 /* 159 https://github.com/paulirish/matchMedia.js 160 */ 161 162 window.matchMedia = window.matchMedia || (function( doc ) { 163 164 'use strict'; 165 166 var bool, 167 docElem = doc.documentElement, 168 refNode = docElem.firstElementChild || docElem.firstChild, 169 // fakeBody required for <FF4 when executed in <head> 170 fakeBody = doc.createElement( 'body' ), 171 div = doc.createElement( 'div' ); 172 173 div.id = 'mq-test-1'; 174 div.style.cssText = 'position:absolute;top:-100em'; 175 fakeBody.style.background = 'none'; 176 fakeBody.appendChild(div); 177 178 return function (q) { 179 180 div.innerHTML = '­<style media="' + q + '"> #mq-test-1 { width: 42px; }</style>'; 181
182 docElem.insertBefore( fakeBody, refNode ); 183 bool = div.offsetWidth === 42; 184 docElem.removeChild( fakeBody ); 185 186 return { 187 matches: bool, 188 media: q 189 }; 190 191 }; 192 193 }( document )); 194 195 /* 196 * jquery.requestAnimationFrame 197 * https://github.com/gnarf37/jquery-requestAnimationFrame 198 * Requires jQuery 1.8+ 199 * 200 * Copyright (c) 2012 Corey Frang 201 * Licensed under the MIT license. 202 */ 203 204 (function($) { 205 206 // requestAnimationFrame polyfill adapted from Erik Möller 207 // fixes from Paul Irish and Tino Zijdel 208 // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 209 // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 210 211 var animating, 212 lastTime = 0, 213 vendors = ['webkit', 'moz'], 214 requestAnimationFrame = window.requestAnimationFrame, 215 cancelAnimationFrame = window.cancelAnimationFrame, 216 jqueryFxAvailable = 'undefined' !== typeof jQuery.fx; 217 218 for (; lastTime < vendors.length && !requestAnimationFrame; lastTime++) { 219 requestAnimationFrame = window[ vendors[lastTime] + 'RequestAnimationFrame' ]; 220 cancelAnimationFrame = cancelAnimationFrame || 221 window[ vendors[lastTime] + 'CancelAnimationFrame' ] || 222 window[ vendors[lastTime] + 'CancelRequestAnimationFrame' ]; 223 } 224 225 function raf() { 226 if (animating) { 227 requestAnimationFrame(raf); 228 229 if (jqueryFxAvailable) { 230 jQuery.fx.tick(); 231 } 232 } 233 } 234 235 if (requestAnimationFrame) { 236 // use rAF 237 window.requestAnimationFrame = requestAnimationFrame; 238 window.cancelAnimationFrame = cancelAnimationFrame; 239 240 if (jqueryFxAvailable) { 241 jQuery.fx.timer = function (timer) { 242 if (timer() && jQuery.timers.push(timer) && !animating) { 243 animating = true; 244 raf(); 245 } 246 }; 247 248 jQuery.fx.stop = function () { 249 animating = false; 250 }; 251 } 252 } else { 253 // polyfill 254 window.requestAnimationFrame = function (callback) { 255 var currTime = new Date().getTime(), 256 timeToCall = Math.max(0, 16 - (currTime - lastTime)), 257 id = window.setTimeout(function () { 258 callback(currTime + timeToCall); 259 }, timeToCall); 260 lastTime = currTime + timeToCall; 261 return id; 262 }; 263 264 window.cancelAnimationFrame = function (id) { 265 clearTimeout(id); 266 }; 267 268 } 269 270 }( jQuery )); 271 272 273 function removeQuotes (string) { 274 if (typeof string === 'string' || string instanceof String) { 275 string = string.replace(/^['\\/"]+|(;\s?})+|['\\/"]+$/g, ''); 276 } 277 278 return string; 279 } 280 281 window.Foundation = { 282 name : 'Foundation', 283 284 version : '5.5.0', 285 286 media_queries : { 287 'small' : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 288 'small-only' : S('.foundation-mq-small-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 289 'medium' : S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 290 'medium-only' : S('.foundation-mq-medium-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
291 'large' : S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 292 'large-only' : S('.foundation-mq-large-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 293 'xlarge' : S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 294 'xlarge-only' : S('.foundation-mq-xlarge-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 295 'xxlarge' : S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '') 296 }, 297 298 stylesheet : $('<style></style>').appendTo('head')[0].sheet, 299 300 global: { 301 namespace: undefined 302 }, 303 304 init : function (scope, libraries, method, options, response) { 305 var args = [scope, method, options, response], 306 responses = []; 307 308 // check RTL 309 this.rtl = /rtl/i.test(S('html').attr('dir')); 310 311 // set foundation global scope 312 this.scope = scope || this.scope; 313 314 this.set_namespace(); 315 316 if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries)) { 317 if (this.libs.hasOwnProperty(libraries)) { 318 responses.push(this.init_lib(libraries, args)); 319 } 320 } else { 321 for (var lib in this.libs) { 322 responses.push(this.init_lib(lib, libraries)); 323 } 324 } 325 326 S(window).load(function(){ 327 S(window) 328 .trigger('resize.fndtn.clearing') 329 .trigger('resize.fndtn.dropdown') 330 .trigger('resize.fndtn.equalizer') 331 .trigger('resize.fndtn.interchange') 332 .trigger('resize.fndtn.joyride') 333 .trigger('resize.fndtn.magellan') 334 .trigger('resize.fndtn.topbar') 335 .trigger('resize.fndtn.slider'); 336 }); 337 338 return scope; 339 }, 340 341 init_lib : function (lib, args) { 342 if (this.libs.hasOwnProperty(lib)) { 343 this.patch(this.libs[lib]); 344 345 if (args && args.hasOwnProperty(lib)) { 346 if (typeof this.libs[lib].settings !== 'undefined') { 347 $.extend(true, this.libs[lib].settings, args[lib]); 348 } 349 else if (typeof this.libs[lib].defaults !== 'undefined') { 350 $.extend(true, this.libs[lib].defaults, args[lib]); 351 } 352 return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]); 353 } 354 355 args = args instanceof Array ? args : new Array(args); 356 return this.libs[lib].init.apply(this.libs[lib], args); 357 } 358 359 return function () {}; 360 }, 361 362 patch : function (lib) { 363 lib.scope = this.scope; 364 lib.namespace = this.global.namespace; 365 lib.rtl = this.rtl; 366 lib['data_options'] = this.utils.data_options; 367 lib['attr_name'] = attr_name; 368 lib['add_namespace'] = add_namespace; 369 lib['bindings'] = bindings; 370 lib['S'] = this.utils.S; 371 }, 372 373 inherit : function (scope, methods) { 374 var methods_arr = methods.split(' '), 375 i = methods_arr.length; 376 377 while (i--) { 378 if (this.utils.hasOwnProperty(methods_arr[i])) { 379 scope[methods_arr[i]] = this.utils[methods_arr[i]]; 380 } 381 } 382 }, 383 384 set_namespace: function () { 385 386 // Description: 387 // Don't bother reading the namespace out of the meta tag 388 // if the namespace has been set globally in javascript 389 // 390 // Example: 391 // Foundation.global.namespace = 'my-namespace'; 392 // or make it an empty string: 393 // Foundation.global.namespace = ''; 394 // 395 // 396 397 // If the namespace has not been set (is undefined), try to read it out of the meta element. 398 // Otherwise use the globally defined namespace, even if it's empty ('') 399 var namespace = ( this.global.namespace === undefined ) ? $('.foundation-data-attribute-namespace').css('font-family') : this.global.namespace; 400 401 // Finally, if the namsepace is either undefined or false, set it to an empty string. 402 // Otherwise use the namespace value. 403 this.global.namespace = ( namespace === undefined || /false/i.test(namespace) ) ? '' : namespace; 404 }, 405 406 libs : {}, 407 408 // methods that can be inherited in libraries 409 utils : { 410 411 // Description: 412 // Fast Selector wrapper returns jQuery object. Only use where getElementById 413 // is not available. 414 // 415 // Arguments:
416 // Selector (String): CSS selector describing the element(s) to be 417 // returned as a jQuery object. 418 // 419 // Scope (String): CSS selector describing the area to be searched. Default 420 // is document. 421 // 422 // Returns: 423 // Element (jQuery Object): jQuery object containing elements matching the 424 // selector within the scope. 425 S : S, 426 427 // Description: 428 // Executes a function a max of once every n milliseconds 429 // 430 // Arguments: 431 // Func (Function): Function to be throttled. 432 // 433 // Delay (Integer): Function execution threshold in milliseconds. 434 // 435 // Returns: 436 // Lazy_function (Function): Function with throttling applied. 437 throttle : function (func, delay) { 438 var timer = null; 439 440 return function () { 441 var context = this, args = arguments; 442 443 if (timer == null) { 444 timer = setTimeout(function () { 445 func.apply(context, args); 446 timer = null; 447 }, delay); 448 } 449 }; 450 }, 451 452 // Description: 453 // Executes a function when it stops being invoked for n seconds 454 // Modified version of _.debounce() http://underscorejs.org 455 // 456 // Arguments: 457 // Func (Function): Function to be debounced. 458 // 459 // Delay (Integer): Function execution threshold in milliseconds. 460 // 461 // Immediate (Bool): Whether the function should be called at the beginning 462 // of the delay instead of the end. Default is false. 463 // 464 // Returns: 465 // Lazy_function (Function): Function with debouncing applied. 466 debounce : function (func, delay, immediate) { 467 var timeout, result; 468 return function () { 469 var context = this, args = arguments; 470 var later = function () { 471 timeout = null; 472 if (!immediate) result = func.apply(context, args); 473 }; 474 var callNow = immediate && !timeout; 475 clearTimeout(timeout); 476 timeout = setTimeout(later, delay); 477 if (callNow) result = func.apply(context, args); 478 return result; 479 }; 480 }, 481 482 // Description: 483 // Parses data-options attribute 484 // 485 // Arguments: 486 // El (jQuery Object): Element to be parsed. 487 // 488 // Returns: 489 // Options (Javascript Object): Contents of the element's data-options 490 // attribute. 491 data_options : function (el, data_attr_name) { 492 data_attr_name = data_attr_name || 'options'; 493 var opts = {}, ii, p, opts_arr, 494 data_options = function (el) { 495 var namespace = Foundation.global.namespace; 496 497 if (namespace.length > 0) { 498 return el.data(namespace + '-' + data_attr_name); 499 } 500 501 return el.data(data_attr_name); 502 }; 503 504 var cached_options = data_options(el); 505 506 if (typeof cached_options === 'object') { 507 return cached_options; 508 } 509 510 opts_arr = (cached_options || ':').split(';'); 511 ii = opts_arr.length; 512 513 function isNumber (o) { 514 return ! isNaN (o-0) && o !== null && o !== '' && o !== false && o !== true; 515 } 516 517 function trim (str) { 518 if (typeof str === 'string') return $.trim(str); 519 return str; 520 } 521 522 while (ii--) { 523 p = opts_arr[ii].split(':'); 524 p = [p[0], p.slice(1).join(':')]; 525 526 if (/true/i.test(p[1])) p[1] = true; 527 if (/false/i.test(p[1])) p[1] = false; 528 if (isNumber(p[1])) { 529 if (p[1].indexOf('.') === -1) { 530 p[1] = parseInt(p[1], 10); 531 } else { 532 p[1] = parseFloat(p[1]); 533 } 534 } 535 536 if (p.length === 2 && p[0].length > 0) { 537 opts[trim(p[0])] = trim(p[1]); 538 } 539 } 540 541 return opts; 542 }, 543 544 // Description: 545 // Adds JS-recognizable media queries 546 // 547 // Arguments: 548 // Media (String): Key string for the media query to be stored as in 549 // Foundation.media_queries 550 //
551 // Class (String): Class name for the generated <meta> tag 552 register_media : function (media, media_class) { 553 if(Foundation.media_queries[media] === undefined) { 554 $('head').append('<meta class="' + media_class + '"/>'); 555 Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family')); 556 } 557 }, 558 559 // Description: 560 // Add custom CSS within a JS-defined media query 561 // 562 // Arguments: 563 // Rule (String): CSS rule to be appended to the document. 564 // 565 // Media (String): Optional media query string for the CSS rule to be 566 // nested under. 567 add_custom_rule : function (rule, media) { 568 if (media === undefined && Foundation.stylesheet) { 569 Foundation.stylesheet.insertRule(rule, Foundation.stylesheet.cssRules.length); 570 } else { 571 var query = Foundation.media_queries[media]; 572 573 if (query !== undefined) { 574 Foundation.stylesheet.insertRule('@media ' + 575 Foundation.media_queries[media] + '{ ' + rule + ' }'); 576 } 577 } 578 }, 579 580 // Description: 581 // Performs a callback function when an image is fully loaded 582 // 583 // Arguments: 584 // Image (jQuery Object): Image(s) to check if loaded. 585 // 586 // Callback (Function): Function to execute when image is fully loaded. 587 image_loaded : function (images, callback) { 588 var self = this, 589 unloaded = images.length; 590 591 if (unloaded === 0) { 592 callback(images); 593 } 594 595 images.each(function () { 596 single_image_loaded(self.S(this), function () { 597 unloaded -= 1; 598 if (unloaded === 0) { 599 callback(images); 600 } 601 }); 602 }); 603 }, 604 605 // Description: 606 // Returns a random, alphanumeric string 607 // 608 // Arguments: 609 // Length (Integer): Length of string to be generated. Defaults to random 610 // integer. 611 // 612 // Returns: 613 // Rand (String): Pseudo-random, alphanumeric string. 614 random_str : function () { 615 if (!this.fidx) this.fidx = 0; 616 this.prefix = this.prefix || [(this.name || 'F'), (+new Date).toString(36)].join('-'); 617 618 return this.prefix + (this.fidx++).toString(36); 619 }, 620 621 // Description: 622 // Helper for window.matchMedia 623 // 624 // Arguments: 625 // mq (String): Media query 626 // 627 // Returns: 628 // (Boolean): Whether the media query passes or not 629 match : function (mq) { 630 return window.matchMedia(mq).matches; 631 }, 632 633 // Description: 634 // Helpers for checking Foundation default media queries with JS 635 // 636 // Returns: 637 // (Boolean): Whether the media query passes or not 638 639 is_small_up : function () { 640 return this.match(Foundation.media_queries.small); 641 }, 642 643 is_medium_up : function () { 644 return this.match(Foundation.media_queries.medium); 645 }, 646 647 is_large_up : function () { 648 return this.match(Foundation.media_queries.large); 649 }, 650 651 is_xlarge_up : function () { 652 return this.match(Foundation.media_queries.xlarge); 653 }, 654 655 is_xxlarge_up : function () { 656 return this.match(Foundation.media_queries.xxlarge); 657 }, 658 659 is_small_only : function () { 660 return !this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up(); 661 }, 662 663 is_medium_only : function () { 664 return this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up(); 665 }, 666 667 is_large_only : function () { 668 return this.is_medium_up() && this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up(); 669 }, 670 671 is_xlarge_only : function () { 672 return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() && !this.is_xxlarge_up(); 673 }, 674 675 is_xxlarge_only : function () { 676 return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() && this.is_xxlarge_up(); 677 } 678 } 679 }; 680 681 $.fn.foundation = function () { 682 var args = Array.prototype.slice.call(arguments, 0); 683 684 return this.each(function () {
685 Foundation.init.apply(Foundation, [this].concat(args)); 686 return this; 687 }); 688 }; 689 690}(jQuery, window, window.document)); 691;(function ($, window, document, undefined) { 692 'use strict'; 693 694 Foundation.libs.equalizer = { 695 name : 'equalizer', 696 697 version : '5.5.0', 698 699 settings : { 700 use_tallest: true, 701 before_height_change: $.noop, 702 after_height_change: $.noop, 703 equalize_on_stack: false 704 }, 705 706 init : function (scope, method, options) { 707 Foundation.inherit(this, 'image_loaded'); 708 this.bindings(method, options); 709 this.reflow(); 710 }, 711 712 events : function () { 713 this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function(e){ 714 this.reflow(); 715 }.bind(this)); 716 }, 717 718 equalize: function(equalizer) { 719 var isStacked = false, 720 vals = equalizer.find('[' + this.attr_name() + '-watch]:visible'), 721 settings = equalizer.data(this.attr_name(true)+'-init'); 722 723 if (vals.length === 0) return; 724 var firstTopOffset = vals.first().offset().top; 725 settings.before_height_change(); 726 equalizer.trigger('before-height-change').trigger('before-height-change.fndth.equalizer'); 727 vals.height('inherit'); 728 vals.each(function(){ 729 var el = $(this); 730 if (el.offset().top !== firstTopOffset) { 731 isStacked = true; 732 } 733 }); 734 735 if (settings.equalize_on_stack === false) { 736 if (isStacked) return; 737 }; 738 739 var heights = vals.map(function(){ return $(this).outerHeight(false) }).get(); 740 741 if (settings.use_tallest) { 742 var max = Math.max.apply(null, heights); 743 vals.css('height', max); 744 } else { 745 var min = Math.min.apply(null, heights); 746 vals.css('height', min); 747 } 748 settings.after_height_change(); 749 equalizer.trigger('after-height-change').trigger('after-height-change.fndtn.equalizer'); 750 }, 751 752 reflow : function () { 753 var self = this; 754 755 this.S('[' + this.attr_name() + ']', this.scope).each(function(){ 756 var $eq_target = $(this); 757 self.image_loaded(self.S('img', this), function(){ 758 self.equalize($eq_target) 759 }); 760 }); 761 } 762 }; 763})(jQuery, window, window.document); 764;(function ($, window, document, undefined) { 765 'use strict'; 766 767 Foundation.libs.offcanvas = { 768 name : 'offcanvas', 769 770 version : '5.5.0', 771 772 settings : { 773 open_method: 'move', 774 close_on_click: false 775 }, 776 777 init : function (scope, method, options) { 778 this.bindings(method, options); 779 }, 780 781 events : function () { 782 var self = this, 783 S = self.S, 784 move_class = '', 785 right_postfix = '', 786 left_postfix = ''; 787 788 if (this.settings.open_method === 'move') { 789 move_class = 'move-'; 790 right_postfix = 'right'; 791 left_postfix = 'left'; 792 } else if (this.settings.open_method === 'overlap_single') { 793 move_class = 'offcanvas-overlap-'; 794 right_postfix = 'right'; 795 left_postfix = 'left'; 796 } else if (this.settings.open_method === 'overlap') { 797 move_class = 'offcanvas-overlap'; 798 } 799 800 S(this.scope).off('.offcanvas') 801 .on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) { 802 self.click_toggle_class(e, move_class + right_postfix); 803 if (self.settings.open_method !== 'overlap'){ 804 S('.left-submenu').removeClass(move_class + right_postfix); 805 } 806 $('.left-off-canvas-toggle').attr('aria-expanded', 'true'); 807 }) 808 .on('click.fndtn.offcanvas', '.left-off-canvas-menu a', function (e) { 809 var settings = self.get_settings(e); 810 var parent = S(this).parent(); 811 812 if(settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')){ 813 self.hide.call(self, move_class + right_postfix, self.get_wrapper(e)); 814 parent.parent().removeClass(move_class + right_postfix); 815 }else if(S(this).parent().hasClass('has-submenu')){ 816 e.preventDefault(); 817 S(this).siblings('.left-submenu').toggleClass(move_class + right_postfix); 818 }else if(parent.hasClass('back')){ 819 e.preventDefault(); 820 parent.parent().removeClass(move_class + right_postfix); 821 } 822 $('.left-off-canvas-toggle').attr('aria-expanded', 'true'); 823 }) 824 .on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) { 825 self.click_toggle_class(e, move_class + left_postfix); 826 if (self.settings.open_method !== 'overlap'){ 827 S('.right-submenu').removeClass(move_class + left_postfix); 828 } 829 $('.right-off-canvas-toggle').attr('aria-expanded', 'true'); 830 }) 831 .on('click.fndtn.offcanvas', '.right-off-canvas-menu a', function (e) { 832 var settings = self.get_settings(e); 833 var parent = S(this).parent(); 834 835 if(settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')){ 836 self.hide.call(self, move_class + left_postfix, self.get_wrapper(e)); 837 parent.parent().removeClass(move_class + left_postfix); 838 }else if(S(this).parent().hasClass('has-submenu')){ 839 e.preventDefault(); 840 S(this).siblings('.right-submenu').toggleClass(move_class + left_postfix); 841 }else if(parent.hasClass('back')){ 842 e.preventDefault(); 843 parent.parent().removeClass(move_class + left_postfix); 844 } 845 $('.right-off-canvas-toggle').attr('aria-expanded', 'true'); 846 }) 847 .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) { 848 self.click_remove_class(e, move_class + left_postfix); 849 S('.right-submenu').removeClass(move_class + left_postfix); 850 if (right_postfix){ 851 self.click_remove_class(e, move_class + right_postfix); 852 S('.left-submenu').removeClass(move_class + left_postfix); 853 } 854 $('.right-off-canvas-toggle').attr('aria-expanded', 'true'); 855 }) 856 .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) { 857 self.click_remove_class(e, move_class + left_postfix); 858 $('.left-off-canvas-toggle').attr('aria-expanded', 'false'); 859 if (right_postfix) { 860 self.click_remove_class(e, move_class + right_postfix); 861 $('.right-off-canvas-toggle').attr('aria-expanded', 'false'); 862 } 863 }); 864 }, 865 866 toggle: function(class_name, $off_canvas) { 867 $off_canvas = $off_canvas || this.get_wrapper(); 868 if ($off_canvas.is('.' + class_name)) { 869 this.hide(class_name, $off_canvas); 870 } else { 871 this.show(class_name, $off_canvas); 872 } 873 }, 874 875 show: function(class_name, $off_canvas) { 876 $off_canvas = $off_canvas || this.get_wrapper(); 877 $off_canvas.trigger('open').trigger('open.fndtn.offcanvas'); 878 $off_canvas.addClass(class_name); 879 }, 880 881 hide: function(class_name, $off_canvas) { 882 $off_canvas = $off_canvas || this.get_wrapper(); 883 $off_canvas.trigger('close').trigger('close.fndtn.offcanvas'); 884 $off_canvas.removeClass(class_name); 885 }, 886
887 click_toggle_class: function(e, class_name) { 888 e.preventDefault(); 889 var $off_canvas = this.get_wrapper(e); 890 this.toggle(class_name, $off_canvas); 891 }, 892 893 click_remove_class: function(e, class_name) { 894 e.preventDefault(); 895 var $off_canvas = this.get_wrapper(e); 896 this.hide(class_name, $off_canvas); 897 }, 898 899 get_settings: function(e) { 900 var offcanvas = this.S(e.target).closest('[' + this.attr_name() + ']'); 901 return offcanvas.data(this.attr_name(true) + '-init') || this.settings; 902 }, 903 904 get_wrapper: function(e) { 905 var $off_canvas = this.S(e ? e.target : this.scope).closest('.off-canvas-wrap'); 906 907 if ($off_canvas.length === 0) { 908 $off_canvas = this.S('.off-canvas-wrap'); 909 } 910 return $off_canvas; 911 }, 912 913 reflow : function () {} 914 }; 915}(jQuery, window, window.document));
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.