aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-10-10 14:27:49 +0200
committerMario Vavti <mario@mariovavti.com>2016-10-10 14:27:49 +0200
commit79a068e92b0f6a4108cb148741fc5f6187928b64 (patch)
tree426a29299694506215c9bd7b00be73982e4d2c4a
parent717a532c09436fd8386fa2a652a1792d0f445cd7 (diff)
downloadvolse-hubzilla-79a068e92b0f6a4108cb148741fc5f6187928b64.tar.gz
volse-hubzilla-79a068e92b0f6a4108cb148741fc5f6187928b64.tar.bz2
volse-hubzilla-79a068e92b0f6a4108cb148741fc5f6187928b64.zip
another fix to readmore.js and update patch file
-rw-r--r--library/readmore.js/hubzilla-custom-fix-webkit-browsers.patch20
-rw-r--r--library/readmore.js/readmore.js4
2 files changed, 21 insertions, 3 deletions
diff --git a/library/readmore.js/hubzilla-custom-fix-webkit-browsers.patch b/library/readmore.js/hubzilla-custom-fix-webkit-browsers.patch
index fd3146152..e947d8854 100644
--- a/library/readmore.js/hubzilla-custom-fix-webkit-browsers.patch
+++ b/library/readmore.js/hubzilla-custom-fix-webkit-browsers.patch
@@ -2,12 +2,30 @@ diff --git a/library/readmore.js/readmore.js b/library/readmore.js/readmore.js
index 34a624e..51222ce 100644
--- a/library/readmore.js/readmore.js
+++ b/library/readmore.js/readmore.js
+@@ -79,7 +79,7 @@
+ maxHeight: 'none',
+ overflow: 'hidden'
+ }).insertAfter(element),
+- expandedHeight = el.outerHeight(),
++ expandedHeight = 100 + '%',
+ cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\d\.]/g, ''), 10),
+ defaultHeight = element.data('defaultHeight');
+
+@@ -102,7 +102,7 @@
+ var resizeBoxes = debounce(function() {
+ $('[data-readmore]').each(function() {
+ var current = $(this),
+- isExpanded = (current.attr('aria-expanded') === 'true');
++ isExpanded = (current.height() > current.data('collapsedHeight'));
+
+ setBoxHeights(current);
+
@@ -246,7 +246,7 @@
collapsedHeight = $element.data('collapsedHeight');
if ($element.height() <= collapsedHeight) {
- newHeight = $element.data('expandedHeight') + 'px';
-+ newHeight = 100 + '%';
++ newHeight = $element.data('expandedHeight');
newLink = 'lessLink';
expanded = true;
}
diff --git a/library/readmore.js/readmore.js b/library/readmore.js/readmore.js
index 8b215dcb4..4c4252e54 100644
--- a/library/readmore.js/readmore.js
+++ b/library/readmore.js/readmore.js
@@ -79,7 +79,7 @@
maxHeight: 'none',
overflow: 'hidden'
}).insertAfter(element),
- expandedHeight = el.outerHeight(),
+ expandedHeight = 100 + '%',
cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\d\.]/g, ''), 10),
defaultHeight = element.data('defaultHeight');
@@ -246,7 +246,7 @@
collapsedHeight = $element.data('collapsedHeight');
if ($element.height() <= collapsedHeight) {
- newHeight = 100 + '%';
+ newHeight = $element.data('expandedHeight');
newLink = 'lessLink';
expanded = true;
}