@contentpilot/read-more
Advanced tools
Comparing version 1.0.1 to 1.0.2
18
index.js
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 1.0.1 | ||
* @version 1.0.2 | ||
* | ||
@@ -70,10 +70,13 @@ * @package Read More | ||
var $showMoreBtn = $(this).parent().find('button.read-more'); | ||
var $showLessBtn = $('<button type="button" class="read-more '+settings.lessCSS+'">'+settings.lessLabel+'</button>'); | ||
var $showLessBtn = $('<button type="button" class="read-less '+settings.lessCSS+'">'+settings.lessLabel+'</button>'); | ||
$showLessBtn.on('click', function() { | ||
$('.read-more-content').fadeOut('slow'); | ||
$showMoreBtn.show(); | ||
$(this).closest('.read-more-content').slideUp('slow', function(){ | ||
// $showMoreBtn.fadeIn('slow'); | ||
$(this).parent().find( $showMoreBtn ).fadeIn('slow'); | ||
}); | ||
}); | ||
$showLessBtn.appendTo($(this).find('.read-more-content').last()); | ||
$showLessBtn.appendTo($(this).parent().find('.read-more-content').last()); | ||
@@ -84,3 +87,6 @@ $showMoreBtn.on('click', function(e) { | ||
$showMoreBtn.hide(); | ||
$showMoreBtn.parent().find('.read-more-content').fadeIn('slow'); | ||
$showMoreBtn.parent().find('.read-more-content').slideDown('slow', function(){ | ||
$(this).find( $showLessBtn ).fadeIn('slow'); | ||
}); | ||
}); | ||
@@ -87,0 +93,0 @@ } |
{ | ||
"name": "@contentpilot/read-more", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Find and convet the WordPress <!--more--> read more tag to toggle all content below", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -19,2 +19,5 @@ # Content Pilot Read More | ||
= 1.0.2 = | ||
* Second try at refactor for just selecting the parent button | ||
= 1.0.1 = | ||
@@ -21,0 +24,0 @@ * Add nesting to find just the parent button to target individual button |
4045
76
26