From 376cfac8d444d74dd8b48148e9a550a238876e68 Mon Sep 17 00:00:00 2001 From: Lars Moelleken Date: Mon, 17 Mar 2014 23:26:14 +0100 Subject: [PATCH] fixed: "carousel" with only one "li" (+ using "S" selector) --- js/foundation/foundation.clearing.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/js/foundation/foundation.clearing.js b/js/foundation/foundation.clearing.js index e5ed64fd9..301abc7fd 100644 --- a/js/foundation/foundation.clearing.js +++ b/js/foundation/foundation.clearing.js @@ -18,7 +18,7 @@ // add 'div.clearing-blackout, div.visible-img' to close on background click close_selectors : '.clearing-close', - touch_label : '← Swipe to Advance →', + touch_label : '', // event initializers and locks init : false, @@ -146,14 +146,24 @@ assemble : function ($li) { var $el = $li.parent(); - if ($el.parent().hasClass('carousel')) return; + if ($el.parent().hasClass('carousel')) { + return; + } + $el.after('
'); - + var grid = $el.detach(); + var grid_outerHTML = ''; + if (grid[0] == null) { + return; + } else { + grid_outerHTML = grid[0].outerHTML; + } + var holder = this.S('#foundationClearingHolder'), settings = $el.data(this.attr_name(true) + '-init'), grid = $el.detach(), data = { - grid: '', + grid: '', viewing: settings.templates.viewing }, wrapper = '
' + data.viewing + @@ -171,10 +181,10 @@ var self = this, body = $(document.body), root = target.closest('.clearing-assembled'), - container = $('div', root).first(), - visible_image = $('.visible-img', container), - image = $('img', visible_image).not($image), - label = $('.clearing-touch-label', '.clearing-blackout'), + container = self.S('div', root).first(), + visible_image = self.S('.visible-img', container), + image = self.S('img', visible_image).not($image), + label = self.S('.clearing-touch-label', container), error = false; image.error(function () { -- 2.47.2