]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fixes #3410 the image shift 6151/head
authorTimofey Rytikov <7timka@gmail.com>
Wed, 24 Dec 2014 23:37:00 +0000 (15:37 -0800)
committerTimofey Rytikov <7timka@gmail.com>
Wed, 24 Dec 2014 23:37:00 +0000 (15:37 -0800)
also trailing spaces removed

js/foundation/foundation.clearing.js
scss/foundation/components/_clearing.scss

index 8c85a58887279bd35c915b50f5fbb22b9fbe6077..a80cf4665f705584c531946829776548b08502c1 100644 (file)
@@ -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 : '',
       if ($el.parent().hasClass('carousel')) {
         return;
       }
-      
+
       $el.after('<div id="foundationClearingHolder"></div>');
 
       var grid = $el.detach(),
       } else {
         grid_outerHTML = grid[0].outerHTML;
       }
-      
+
       var holder = this.S('#foundationClearingHolder'),
           settings = $el.data(this.attr_name(true) + '-init'),
           data = {
           .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
     },
 
     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;
     },
           .hide();
       }
       return this;
-    }, 
+    },
 
     // directional methods
 
index 737af29959b8f5bf63f3c4f55402caaabe3ba185..a6a5f80cb710fa2d15a5f84931b2ec133650e6db 100644 (file)
@@ -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; }