aluminum-components
Advanced tools
Comparing version 0.2.15 to 0.2.16
@@ -30,2 +30,23 @@ (function ($) { | ||
function setReadMoreContainerAttributes(readMoreContainer) { | ||
var item = $(readMoreContainer); | ||
var height = item.data('height') || '13em'; | ||
var content = getReadMoreContent(item); | ||
var bottom = getReadMoreBottom(item); | ||
var originalHeight = content.height(); | ||
content.css({height: height}); | ||
var newHeight = content.height(); | ||
if (newHeight > originalHeight - 30) { | ||
content.css({height: 'auto'}); | ||
item.addClass('is-disabled'); | ||
} | ||
else { | ||
item.data('originalHeight', originalHeight + 'px'); | ||
bottom.css({display: 'block'}); | ||
item.toggleClass('is-closed', true); | ||
} | ||
} | ||
Drupal.behaviors.readMoreContainer = { | ||
@@ -37,17 +58,11 @@ attach: function (context, settings) { | ||
var item = $(this); | ||
var height = item.data('height') || '13em'; | ||
var content = getReadMoreContent(item); | ||
var bottom = getReadMoreBottom(item); | ||
var originalHeight = content.height(); | ||
content.css({height: height}); | ||
var newHeight = content.height(); | ||
if (newHeight > originalHeight - 30) { | ||
content.css({height: 'auto'}); | ||
item.addClass('is-disabled'); | ||
if (originalHeight) { | ||
setReadMoreContainerAttributes(item); | ||
} else { | ||
item.data('originalHeight', originalHeight + 'px'); | ||
bottom.css({display: 'block'}); | ||
item.toggleClass('is-closed', true); | ||
setTimeout(function () { | ||
setReadMoreContainerAttributes(item); | ||
}, 500); | ||
} | ||
@@ -54,0 +69,0 @@ }); |
{ | ||
"name": "aluminum-components", | ||
"version": "0.2.15", | ||
"version": "0.2.16", | ||
"description": "A set of reusable web components (JS, SCSS mixins and styles, and template examples) for quickly building custom themes and web applications.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59184
160