{I" class:ETI"BundledAsset; FI"logical_path; TI"&foundation/foundation.clearing.js; FI" pathname; TI"{/home/meddle/.rbenv/versions/2.0.0-p353/gemsets/yatoto/gems/zurb-foundation-4.0.9/js/foundation/foundation.clearing.js; FI"content_type; TI"application/javascript; TI" mtime; Tl+RI"length; Ti³5I"digest; TI"%e6e8ce33fd75993c727fff4e4e8d8bee; FI"source; TI"³5/*jslint unparam: true, browser: true, indent: 2 */ ;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.clearing = { name : 'clearing', version : '4.0.0', settings : { templates : { viewing : '×' + '
' }, // comma delimited list of selectors that, on click, will close clearing, // add 'div.clearing-blackout, div.visible-img' to close on background click close_selectors : '.clearing-close', // event initializers and locks init : false, locked : false }, init : function (scope, method, options) { this.scope = this.scope || scope; Foundation.inherit(this, 'set_data get_data remove_data throttle'); if (typeof method === 'object') { options = $.extend(true, this.settings, method); } if (typeof method != 'string') { $(this.scope).find('ul[data-clearing]').each(function () { var self = Foundation.libs.clearing, $el = $(this), options = options || {}, settings = self.get_data($el); if (!settings) { options.$parent = $el.parent(); self.set_data($el, $.extend(true, self.settings, options)); self.assemble($el.find('li')); if (!self.settings.init) { self.events().swipe_events(); } } }); return this.settings.init; } else { // fire method return this[method].call(this, options); } }, // event binding and initial setup events : function () { var self = this; $(this.scope) .on('click.fndtn.clearing', 'ul[data-clearing] li', function (e, current, target) { var current = current || $(this), target = target || current, settings = self.get_data(current.parent()); e.preventDefault(); if (!settings) self.init(); // set current and target to the clicked li if not otherwise defined. self.open($(e.target), current, target); self.update_paddles(target); }) .on('click.fndtn.clearing', '.clearing-main-right', function (e) { this.nav(e, 'next') }.bind(this)) .on('click.fndtn.clearing', '.clearing-main-left', function (e) { this.nav(e, 'prev') }.bind(this)) .on('click.fndtn.clearing', this.settings.close_selectors, function (e) { Foundation.libs.clearing.close(e, this) }) .on('keydown.fndtn.clearing', function (e) { this.keydown(e) }.bind(this)); $(window).on('resize.fndtn.clearing', function (e) { this.resize() }.bind(this)); this.settings.init = true; return this; }, swipe_events : function () { var self = this; $(this.scope) .on('touchstart.fndtn.clearing', '.visible-img', function(e) { if (!e.touches) { e = e.originalEvent; } var data = { start_page_x: e.touches[0].pageX, start_page_y: e.touches[0].pageY, start_time: (new Date()).getTime(), delta_x: 0, is_scrolling: undefined }; $(this).data('swipe-transition', data); e.stopPropagation(); }) .on('touchmove.fndtn.clearing', '.visible-img', function(e) { if (!e.touches) { e = e.originalEvent; } // Ignore pinch/zoom events if(e.touches.length > 1 || e.scale && e.scale !== 1) return; var data = $(this).data('swipe-transition'); if (typeof data === 'undefined') { data = {}; } data.delta_x = e.touches[0].pageX - data.start_page_x; if ( typeof data.is_scrolling === 'undefined') { data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) ); } if (!data.is_scrolling && !data.active) { e.preventDefault(); var direction = (data.delta_x < 0) ? 'next' : 'prev'; data.active = true; self.nav(e, direction); } }) .on('touchend.fndtn.clearing', '.visible-img', function(e) { $(this).data('swipe-transition', {}); e.stopPropagation(); }); }, assemble : function ($li) { var $el = $li.parent(), settings = this.get_data($el), grid = $el.detach(), data = { grid: '