From e6a6122e1de0e0c990a6bd85759789e5972c017c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 8 Mar 2012 15:06:33 +0100 Subject: [PATCH] Removed wcfGrow() and .wcfDimensions Closes #506 --- wcfsetup/install/files/acp/style/wcf.css | 9 ---- wcfsetup/install/files/acp/style/wcf.less | 9 ---- wcfsetup/install/files/js/WCF.js | 53 ----------------------- 3 files changed, 71 deletions(-) diff --git a/wcfsetup/install/files/acp/style/wcf.css b/wcfsetup/install/files/acp/style/wcf.css index 7569ba6ca8..0cd6db2650 100644 --- a/wcfsetup/install/files/acp/style/wcf.css +++ b/wcfsetup/install/files/acp/style/wcf.css @@ -4539,15 +4539,6 @@ button[disabled] { /* ############## CSS Experiments (active) ############## */ -/* what is that? */ -/* Once we're determing the dimensions of an element (by JS) we move it into body and wrap it with - a container with class 'wcfDimensions' in order to calculate the precise dimensions. We could also - embed it directly in JS (using style-attribute) but I thought it was better this way. - Alex */ -.wcfDimensions { - display: inline-block; -} - - diff --git a/wcfsetup/install/files/acp/style/wcf.less b/wcfsetup/install/files/acp/style/wcf.less index dd39a4ac5a..1c56c4a024 100644 --- a/wcfsetup/install/files/acp/style/wcf.less +++ b/wcfsetup/install/files/acp/style/wcf.less @@ -4539,15 +4539,6 @@ button[disabled] { /* ############## CSS Experiments (active) ############## */ -/* what is that? */ -/* Once we're determing the dimensions of an element (by JS) we move it into body and wrap it with - a container with class 'wcfDimensions' in order to calculate the precise dimensions. We could also - embed it directly in JS (using style-attribute) but I thought it was better this way. - Alex */ -.wcfDimensions { - display: inline-block; -} - - diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 6635565da4..80ff50c6c9 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -270,59 +270,6 @@ $.fn.extend({ return this.attr('id'); }, - /** - * CAUTION: This method does not work properly, you should not rely - * on it for now. It seems to work with the old jQuery UI- - * based dialog, but no longer works with usual elements. - * I will either try to fix it or remove it later, thus - * this method will be deprecated for now. -Alexander - * - * Applies a grow-effect by resizing element while moving the element - * appropriately. Make sure the passed data.content element contains - * all elements which affect this indirectly, this includes outer - * containers which may apply an obstrusive padding. - * - * @deprecated - * @param object data - * @param object options - * @return jQuery - */ - wcfGrow: function(data, options) { - var $content = $(data.content); - var $parent = (data.parent) ? $(data.parent) : $(this); - - // calculate dimensions - var $windowDimensions = $(window).getDimensions(); - var $elementDimensions = $content.getDimensions('outer'); - var $parentDimensions = $parent.getDimensions('outer'); - var $parentInnerDimensions = $parent.getDimensions('inner'); - var $parentDifference = { - height: $parentDimensions.height - $parentInnerDimensions.height, - width: $parentDimensions.width - $parentInnerDimensions.width - }; - - // calculate offsets - var $leftOffset = Math.round(($windowDimensions.width - ($elementDimensions.width + $parentDifference.width)) / 2); - var $topOffset = Math.round(($windowDimensions.height - ($elementDimensions.height + $parentDifference.height)) / 2); - - // try to align vertically at 30% if previously calculated value is NOT lower - var $desiredTopOffset = Math.round(($windowDimensions / 100) * 30); - if ($desiredTopOffset < $topOffset) { - $topOffset = $desiredTopOffset; - } - - $parent.makePositioned('fixed', false); - $parent.animate({ - left: $leftOffset + 'px', - top: $topOffset + 'px' - }, options); - - return this.animate({ - height: $elementDimensions.height, - width: $elementDimensions.width - }, options); - }, - /** * Shows an element by sliding and fading it into viewport. * -- 2.20.1