Readmore.js icon indicating copy to clipboard operation
Readmore.js copied to clipboard

Big white space after open text block

Open Pupinia opened this issue 5 years ago • 8 comments

I think i have same issue After click on 'read more' i have big white space in bottom my block. Version chrome on mobile - 72.

Pupinia avatar Mar 15 '19 08:03 Pupinia

+1. Still actual in v3.

rawthriver avatar Jan 25 '20 09:01 rawthriver

could we get this fixed..?

w3human avatar Aug 05 '20 18:08 w3human

on mobile.

w3human avatar Aug 05 '20 18:08 w3human

function setBoxHeights(element) { var el = element.clone().css({ height: 'auto', width: element.width(), maxHeight: 'none', overflow: 'hidden' }).insertAfter(element), expandedHeight = element.outerHeight(), cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\d.]/g, ''), 10), defaultHeight = element.data('defaultHeight');

w3human avatar Aug 05 '20 20:08 w3human

@Pupinia solved for us. @jedfoster would love it check this in!

w3human avatar Aug 05 '20 20:08 w3human

changed el to element, when setting expandedHeight

w3human avatar Aug 05 '20 20:08 w3human

@w3human I'd be happy to consider a PR.

jedfoster avatar Aug 05 '20 20:08 jedfoster

function setBoxHeights(element) { var el = element.clone().css({ height: 'auto', width: element.width(), maxHeight: 'none', overflow: 'hidden' }).insertAfter(element); element.css('height', 'auto');

    var expandedHeight = element.outerHeight(),
    cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\d\.]/g, ''), 10),
    defaultHeight = element.data('defaultHeight');

el.remove();

var collapsedHeight = cssMaxHeight || element.data('collapsedHeight') || defaultHeight;

// Store our measurements.
element.data({
  expandedHeight: expandedHeight,
  maxHeight: cssMaxHeight,
  collapsedHeight: collapsedHeight,
  defaultHeight: defaultHeight,
})
// and disable any `max-height` property set in CSS
.css({
  maxHeight: 'none'
});

}

w3human avatar Aug 05 '20 22:08 w3human