From: Timofey Rytikov <7timka@gmail.com> Date: Wed, 24 Dec 2014 23:37:00 +0000 (-0800) Subject: Fixes #3410 the image shift X-Git-Tag: v5.5.1~43^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6151%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fixes #3410 the image shift also trailing spaces removed --- diff --git a/js/foundation/foundation.clearing.js b/js/foundation/foundation.clearing.js index 8c85a5888..a80cf4665 100644 --- a/js/foundation/foundation.clearing.js +++ b/js/foundation/foundation.clearing.js @@ -16,7 +16,7 @@ // 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, div.clearing-blackout', + close_selectors : '.clearing-close, div.clearing-blackout', // Default to the entire li element. open_selectors : '', @@ -160,7 +160,7 @@ if ($el.parent().hasClass('carousel')) { return; } - + $el.after('
'); var grid = $el.detach(), @@ -171,7 +171,7 @@ } else { grid_outerHTML = grid[0].outerHTML; } - + var holder = this.S('#foundationClearingHolder'), settings = $el.data(this.attr_name(true) + '-init'), data = { @@ -272,7 +272,7 @@ .removeClass('clearing-blackout'); container.removeClass('clearing-container'); visible_image.hide(); - visible_image.trigger('closed.fndtn.clearing'); + visible_image.trigger('closed.fndtn.clearing'); } // Event to re-enable scrolling on touch devices @@ -352,34 +352,18 @@ }, center_and_label : function (target, label) { - if (!this.rtl) { - target.css({ - marginLeft : -(target.outerWidth() / 2), - marginTop : -(target.outerHeight() / 2) + if (!this.rtl && label.length > 0) { + label.css({ + marginLeft : -(label.outerWidth() / 2), + marginTop : -(target.outerHeight() / 2)-label.outerHeight()-10 }); - - if (label.length > 0) { - label.css({ - marginLeft : -(label.outerWidth() / 2), - marginTop : -(target.outerHeight() / 2)-label.outerHeight()-10 - }); - } } else { - target.css({ - marginRight : -(target.outerWidth() / 2), - marginTop : -(target.outerHeight() / 2), + label.css({ + marginRight : -(label.outerWidth() / 2), + marginTop : -(target.outerHeight() / 2)-label.outerHeight()-10, left: 'auto', right: '50%' }); - - if (label.length > 0) { - label.css({ - marginRight : -(label.outerWidth() / 2), - marginTop : -(target.outerHeight() / 2)-label.outerHeight()-10, - left: 'auto', - right: '50%' - }); - } } return this; }, @@ -436,7 +420,7 @@ .hide(); } return this; - }, + }, // directional methods diff --git a/scss/foundation/components/_clearing.scss b/scss/foundation/components/_clearing.scss index 737af2995..a6a5f80cb 100644 --- a/scss/foundation/components/_clearing.scss +++ b/scss/foundation/components/_clearing.scss @@ -93,7 +93,16 @@ $clearing-carousel-thumb-active-border: 1px solid rgb(255,255,255) !default; position: absolute; #{$default-float}: 50%; top: 50%; - margin-#{$default-float}: -50%; + @if $default-float == left { + transform: translateY(-50%) translateX(-50%); + -webkit-transform: translateY(-50%) translateX(-50%); + -ms-transform: translateY(-50%) translateX(-50%); + } + @else { + transform: translateY(-50%) translateX(50%); + -webkit-transform: translateY(-50%) translateX(50%); + -ms-transform: translateY(-50%) translateX(50%); + }; max-height: 100%; max-width: 100%; } @@ -171,7 +180,7 @@ $clearing-carousel-thumb-active-border: 1px solid rgb(255,255,255) !default; border-#{$default-float}-color: $clearing-arrow-color; } } - + .clearing-main-prev.disabled, .clearing-main-next.disabled { opacity: 0.3; }