summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfubhy2011-07-16 22:28:21 (GMT)
committer fubhy2011-07-16 22:28:21 (GMT)
commit0cd093c7dd2753d481f4bd879797dc4198e13e10 (patch)
tree98ae3f7b9a71a23f9effcaeef3666436ce142656
parent4ceb6470bc992ec76ac27bb28a21134d9beda606 (diff)
#1220198 - The equal height feature is now solely based on CSS. This might still not
be the perfect solution but the jQuery approach that we were using before proved to be a dead end.
-rw-r--r--CHANGELOG.txt6
-rw-r--r--omega/css/omega-equalheights.css15
-rw-r--r--omega/js/jquery.equalheights.js40
-rw-r--r--omega/js/omega-equalheights.js26
-rw-r--r--omega/omega.info4
-rw-r--r--omega/preprocess/preprocess-block.inc2
-rw-r--r--omega/preprocess/preprocess-region.inc2
-rw-r--r--omega/template.php15
8 files changed, 38 insertions, 72 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 6885601..58897fa 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -36,6 +36,12 @@ CHANGELOG.txt to track changes to the Omega theme.
##### Pending changes for Next Release
##########################################################################################
+7/17/11
+=========
+#1220198 - The equal height feature is now solely based on CSS. This might still not
+be the perfect solution but the jQuery approach that we were using before proved to be
+a dead end.
+
7/09/11
=========
#1214048 - Omega no longer abuses the variables table for the caching. Instead we are
diff --git a/omega/css/omega-equalheights.css b/omega/css/omega-equalheights.css
new file mode 100644
index 0000000..59b1ef2
--- /dev/null
+++ b/omega/css/omega-equalheights.css
@@ -0,0 +1,15 @@
+.equal-height-container {
+ overflow-y: hidden;
+ *position: relative; /* IE7 */
+}
+
+.equal-height-region,
+.equal-height-block {
+ margin-bottom: -9999em;
+ padding-bottom: 9999em;
+}
+
+.equal-height-region .region-inner,
+.equal-height-block .block-inner {
+ height: 100%;
+} \ No newline at end of file
diff --git a/omega/js/jquery.equalheights.js b/omega/js/jquery.equalheights.js
deleted file mode 100644
index 2668c48..0000000
--- a/omega/js/jquery.equalheights.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Equal Heights Plugin
- * Equalize the heights of elements. Great for columns or any elements
- * that need to be the same size (floats, etc).
- *
- * Version 1.0
- * Updated 12/10/2008
- *
- * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com)
- *
- * Modified for Omega by Sebastian Siemssen (fubhy)
- *
- * Usage: $(object).equalHeights([minHeight], [maxHeight]);
- *
- * Example 1: $('.cols').equalHeights(); Sets all columns to the same height.
- * Example 2: $('.cols').equalHeights(400); Sets all cols to at least 400px tall.
- * Example 3: $('.cols').equalHeights(100,300); Cols are at least 100 but no more
- * than 300 pixels tall. Elements with too much content will gain a scrollbar.
- */
-
-(function($) {
- $.fn.equalHeights = function(minHeight, maxHeight) {
- var tallest = (minHeight) ? minHeight : 0;
-
- this.each(function() {
- if ($(this).height() > tallest)
- tallest = $(this).height();
- });
-
- if ((maxHeight) && tallest > maxHeight)
- tallest = maxHeight;
-
- return this.each(function() {
- if (tallest < $(this).height())
- $(this).css('overflow', 'scroll');
-
- $(this).height(tallest);
- });
- }
-})(jQuery); \ No newline at end of file
diff --git a/omega/js/omega-equalheights.js b/omega/js/omega-equalheights.js
deleted file mode 100644
index b6dec51..0000000
--- a/omega/js/omega-equalheights.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * @todo
- */
-
-(function($) {
- /**
- * @todo
- */
- Drupal.behaviors.omegaEqualHeights = {
- attach: function (context) {
- $('body', context).once('omega-equalheights', function () {
- $(window).bind('resize.omegaequalheights', function () {
- $($('.equal-height-container').get().reverse()).each(function () {
- var children = $(this).children('.equal-height-element').height('auto');
-
- if (!Drupal.behaviors.hasOwnProperty('omegaMediaQueries') || Drupal.omega.getCurrentLayout() != 'mobile') {
- children.equalHeights();
- }
- });
- }).load(function () {
- $(this).trigger('resize.omegaequalheights');
- });
- });
- }
- };
-})(jQuery); \ No newline at end of file
diff --git a/omega/omega.info b/omega/omega.info
index 40c105c..4312ed5 100644
--- a/omega/omega.info
+++ b/omega/omega.info
@@ -89,10 +89,6 @@ libraries[omega_mediaqueries][js][0][options][weight] = -19
libraries[omega_equalheights][name] = Equal heights
libraries[omega_equalheights][description] = Allows you to force all regions of a zone or all blocks of a region to be of equal size. <span class="marker">This library reveals a corresponding checkbox on every region and zone configuration panel if activated.</span>
-libraries[omega_equalheights][js][0][file] = jquery.equalheights.js
-libraries[omega_equalheights][js][0][options][weight] = -18
-libraries[omega_equalheights][js][1][file] = omega-equalheights.js
-libraries[omega_equalheights][js][1][options][weight] = -18
; THEME SETTINGS (DEFAULTS)
diff --git a/omega/preprocess/preprocess-block.inc b/omega/preprocess/preprocess-block.inc
index 705a3bd..3c9867f 100644
--- a/omega/preprocess/preprocess-block.inc
+++ b/omega/preprocess/preprocess-block.inc
@@ -28,7 +28,7 @@ function omega_alpha_preprocess_block(&$vars) {
if ($vars['block']->module != 'alpha-debug' && isset($vars['block']->region)) {
if (alpha_library_active('omega_equalheights') && $region = alpha_regions($vars['block']->region)) {
if ($region['equal_height']) {
- $vars['attributes_array']['class'][] = 'equal-height-element';
+ $vars['attributes_array']['class'][] = 'equal-height-block';
}
}
}
diff --git a/omega/preprocess/preprocess-region.inc b/omega/preprocess/preprocess-region.inc
index 02dbbf9..b40e912 100644
--- a/omega/preprocess/preprocess-region.inc
+++ b/omega/preprocess/preprocess-region.inc
@@ -24,7 +24,7 @@ function omega_alpha_preprocess_region(&$vars) {
$zone = alpha_zones($data['zone']);
if ($zone['equal_height']) {
- $vars['attributes_array']['class'][] = 'equal-height-element';
+ $vars['attributes_array']['class'][] = 'equal-height-region';
}
}
}
diff --git a/omega/template.php b/omega/template.php
index 39e452d..de59e47 100644
--- a/omega/template.php
+++ b/omega/template.php
@@ -19,4 +19,19 @@ function omega_alpha_zones_alter(&$zones, $theme) {
foreach ($zones as $zone => &$item) {
$item['equal_height'] = alpha_zone_get_setting('equal_height', $zone, FALSE, $theme);
}
+}
+
+/**
+ * Implements hook_alpha_grid_registry_alter().
+ */
+function omega_alpha_grids_registry_alter(&$grids, $theme) {
+ $path = drupal_get_path('theme', 'omega') . '/css';
+
+ if (alpha_library_active('omega_equalheights') && $attached = alpha_find_stylesheet($path, 'omega-equalheights')) {
+ foreach ($grids as &$grid) {
+ foreach ($grid['layouts'] as &$layout) {
+ array_unshift($layout['attached'], $attached);
+ }
+ }
+ }
} \ No newline at end of file