From 21df81ab40bbb88713a456f4242b3cca56f39a22 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 15 May 2015 15:27:04 -0400 Subject: [PATCH] Slightly more efficient shape calcs --- src/definitions/modules/shape.js | 35 ++++++++++++++++++------------ src/definitions/modules/shape.less | 1 + 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/definitions/modules/shape.js b/src/definitions/modules/shape.js index d42a1f8b8..9485302aa 100644 --- a/src/definitions/modules/shape.js +++ b/src/definitions/modules/shape.js @@ -511,7 +511,6 @@ $.fn.shape = function(parameters) { $nextSide .addClass(className.animating) .css({ - 'display' : 'block', 'top' : box.origin + 'px', 'transform' : 'rotateX(90deg) translateZ(' + box.depth.next + 'px)' }) @@ -542,7 +541,6 @@ $.fn.shape = function(parameters) { $nextSide .addClass(className.animating) .css({ - 'display' : 'block', 'top' : box.origin + 'px', 'transform' : 'rotateX(-90deg) translateZ(' + box.depth.next + 'px)' }) @@ -551,11 +549,15 @@ $.fn.shape = function(parameters) { left: function() { var + height = { + active : $activeSide.outerWidth(true), + next : $nextSide.outerWidth(true) + }, box = { - origin : ( ( $activeSide.outerWidth(true) - $nextSide.outerWidth(true) ) / 2), + origin : ( ( height.active - height.next ) / 2), depth : { - active : ($nextSide.outerWidth(true) / 2), - next : ($activeSide.outerWidth(true) / 2) + active : (height.next / 2), + next : (height.active / 2) } } ; @@ -573,7 +575,6 @@ $.fn.shape = function(parameters) { $nextSide .addClass(className.animating) .css({ - 'display' : 'block', 'left' : box.origin + 'px', 'transform' : 'rotateY(-90deg) translateZ(' + box.depth.next + 'px)' }) @@ -582,11 +583,15 @@ $.fn.shape = function(parameters) { right: function() { var + height = { + active : $activeSide.outerWidth(true), + next : $nextSide.outerWidth(true) + }, box = { - origin : ( ( $activeSide.outerWidth(true) - $nextSide.outerWidth(true) ) / 2), + origin : ( ( height.active - height.next ) / 2), depth : { - active : ($nextSide.outerWidth(true) / 2), - next : ($activeSide.outerWidth(true) / 2) + active : (height.next / 2), + next : (height.active / 2) } } ; @@ -604,7 +609,6 @@ $.fn.shape = function(parameters) { $nextSide .addClass(className.animating) .css({ - 'display' : 'block', 'left' : box.origin + 'px', 'transform' : 'rotateY(90deg) translateZ(' + box.depth.next + 'px)' }) @@ -613,11 +617,15 @@ $.fn.shape = function(parameters) { behind: function() { var + height = { + active : $activeSide.outerWidth(true), + next : $nextSide.outerWidth(true) + }, box = { - origin : ( ( $activeSide.outerWidth(true) - $nextSide.outerWidth(true) ) / 2), + origin : ( ( height.active - height.next ) / 2), depth : { - active : ($nextSide.outerWidth(true) / 2), - next : ($activeSide.outerWidth(true) / 2) + active : (height.next / 2), + next : (height.active / 2) } } ; @@ -630,7 +638,6 @@ $.fn.shape = function(parameters) { $nextSide .addClass(className.animating) .css({ - 'display' : 'block', 'left' : box.origin + 'px', 'transform' : 'rotateY(-180deg)' }) diff --git a/src/definitions/modules/shape.less b/src/definitions/modules/shape.less index 21d33bd13..2364e2512 100755 --- a/src/definitions/modules/shape.less +++ b/src/definitions/modules/shape.less @@ -118,6 +118,7 @@ position: absolute; top: 0px; left: 0px; + display: block; z-index: @animatingZIndex; } .ui.shape .hidden.side {