From 29e0bfee2f8e5a3e9a1d73f84c2c1f80b4637c3f Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Tue, 6 Jan 2015 15:54:58 +0100 Subject: Fix bug in readmore.js --- library/readmore.js/readmore.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'library') diff --git a/library/readmore.js/readmore.js b/library/readmore.js/readmore.js index 81cfb3cea..171f69776 100644 --- a/library/readmore.js/readmore.js +++ b/library/readmore.js/readmore.js @@ -148,7 +148,6 @@ this.element = element; this.options = $.extend({}, defaults, options); - $(this.element).data({ defaultHeight: this.options.collapsedHeight, heightMargin: this.options.heightMargin @@ -159,9 +158,11 @@ this._defaults = defaults; this._name = readmore; - window.addEventListener('load', function() { + // Waiting for the page to load doesn't work when there is dynamic content + // But usually we already have the content, so no need to wait + //window.addEventListener('load', function() { $this.init(); - }); + //}); } -- cgit v1.2.3