{I" class:ETI"ProcessedAsset; FI"logical_path; TI"&foundation/foundation.clearing.js; FI" pathname; TI"p/home/guda/.rvm/gems/ruby-2.0.0-p481@yatoto/gems/zurb-foundation-4.3.2/js/foundation/foundation.clearing.js; FI"content_type; TI"application/javascript; TI" mtime; Tl+'è£SI"length; Ti:I"digest; TI"%ae2d2b259338bf3bd9e3ca8a5a8ea9d2; FI"source; TI":/*jslint unparam: true, browser: true, indent: 2 */ ;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.clearing = { name : 'clearing', version: '4.3.2', 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) { var self = this; Foundation.inherit(this, 'set_data get_data remove_data throttle data_options'); if (typeof method === 'object') { options = $.extend(true, this.settings, method); } if (typeof method !== 'string') { $(this.scope).find('ul[data-clearing]').each(function () { var $el = $(this), options = options || {}, lis = $el.find('li'), settings = self.get_data($el); if (!settings && lis.length > 0) { options.$parent = $el.parent(); self.set_data($el, $.extend({}, self.settings, options, self.data_options($el))); 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, next = current.next('li'), settings = self.get_data(current.parent()), image = $(e.target); e.preventDefault(); if (!settings) self.init(); // if clearing is open and the current image is // clicked, go to the next image in sequence if (target.hasClass('visible') && current[0] === target[0] && next.length > 0 && self.is_open(current)) { target = next; image = target.find('img'); } // set current and target to the clicked li if not otherwise defined. self.open(image, current, target); self.update_paddles(target); }) .on('click.fndtn.clearing', '.clearing-main-next', function (e) { this.nav(e, 'next') }.bind(this)) .on('click.fndtn.clearing', '.clearing-main-prev', 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 () { 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(); $el.after(''); var holder = $('#foundationClearingHolder'), settings = this.get_data($el), grid = $el.detach(), data = { grid: '