From: Lars Moelleken Date: Mon, 17 Mar 2014 22:26:14 +0000 (+0100) Subject: fixed: "carousel" with only one "li" (+ using "S" selector) X-Git-Tag: v5.2.2~112^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4715%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fixed: "carousel" with only one "li" (+ using "S" selector) --- 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 () {