Skip to content

Commit

Permalink
fix to preserve inline styles
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Sep 16, 2014
1 parent 72ba5cf commit e9de702
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions jquery.matchHeight.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@
var $that = $(this),
display = $that.css('display') === 'inline-block' ? 'inline-block' : 'block';

$that.data('original_style', $that.attr('style')).css({
// cache the original inline style
$that.data('style-cache', $that.attr('style'));

$that.css({
'display': display,
'padding-top': '0',
'padding-bottom': '0',
Expand All @@ -144,10 +147,12 @@
// get the array of rows (based on element top position)
rows = _rows($elements);

// revert original inline styles
$elements.each(function() {
var $that = $(this);

$that.attr('style', $that.data('original_style'));
$that.attr('style', $that.data('style-cache') || '')
.css('height', '');
});
}

Expand Down

0 comments on commit e9de702

Please sign in to comment.