Actually fix problem with post collapsing in webkit-based browsers
This commit is contained in:
parent
47a2668b30
commit
478a612aeb
@ -61,18 +61,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setBoxHeights(element) {
|
function setBoxHeights(element) {
|
||||||
var el = element.clone().css({
|
var el = element,
|
||||||
height: 'auto',
|
|
||||||
width: element.width(),
|
|
||||||
maxHeight: 'none',
|
|
||||||
overflow: 'hidden'
|
|
||||||
}).insertAfter(element),
|
|
||||||
expandedHeight = el.outerHeight(),
|
expandedHeight = el.outerHeight(),
|
||||||
cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\d\.]/g, ''), 10),
|
cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\d\.]/g, ''), 10),
|
||||||
defaultHeight = element.data('defaultHeight');
|
defaultHeight = element.data('defaultHeight');
|
||||||
|
|
||||||
el.remove();
|
console.log("el height: " + expandedHeight);
|
||||||
|
|
||||||
var collapsedHeight = element.data('collapsedHeight') || defaultHeight;
|
var collapsedHeight = element.data('collapsedHeight') || defaultHeight;
|
||||||
|
|
||||||
if (!cssMaxHeight) {
|
if (!cssMaxHeight) {
|
||||||
@ -206,10 +200,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('resize', function() {
|
|
||||||
resizeBoxes();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
toggle: function(trigger, element, event) {
|
toggle: function(trigger, element, event) {
|
||||||
@ -225,8 +215,6 @@
|
|||||||
element = this.element;
|
element = this.element;
|
||||||
}
|
}
|
||||||
|
|
||||||
setBoxHeights($(element)); // Workaroud for problems with collapse
|
|
||||||
|
|
||||||
var $this = this,
|
var $this = this,
|
||||||
$element = $(element),
|
$element = $(element),
|
||||||
newHeight = '',
|
newHeight = '',
|
||||||
|
Reference in New Issue
Block a user