Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
bugfix when truncating text only
  • Loading branch information
FrDH committed Oct 12, 2017
1 parent 558cd03 commit 2706163
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "jQuery.dotdotdot",
"version" : "3.0.3",
"version" : "3.0.4",
"main" : "dist/jquery.dotdotdot.js",
"authors" : "Fred Heusschen <[email protected]>",
"license" : "CC-BY-NC-4.0",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "jQuery.dotdotdot",
"version" : "3.0.3",
"version" : "3.0.4",
"authors" : "Fred Heusschen <[email protected]>",
"license" : "CC-BY-NC-4.0",
"description" : "Dotdotdot is an advanced jQuery plugin for truncating multiple line content with an ellipsis.",
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.dotdotdot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "jquery.dotdotdot",
"version" : "3.0.3",
"version" : "3.0.4",
"main" : "dist/jquery.dotdotdot.js",
"author" : "Fred Heusschen <[email protected]>",
"license" : "CC-BY-NC-4.0",
Expand Down
17 changes: 7 additions & 10 deletions src/jquery.dotdotdot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery dotdotdot 3.0.3
* jQuery dotdotdot 3.0.4
* @requires jQuery 1.7.0 or later
*
* dotdotdot.frebsite.nl
Expand All @@ -15,7 +15,7 @@
'use strict';

var _PLUGIN_ = 'dotdotdot';
var _VERSION_ = '3.0.3';
var _VERSION_ = '3.0.4';

if ( $[ _PLUGIN_ ] && $[ _PLUGIN_ ].version > _VERSION_ )
{
Expand Down Expand Up @@ -131,12 +131,13 @@
// Filter contents
this.$inner
.find( '*' )
.add( this.$inner )
.not( '.' + _c.keep )
.add( this.$inner )
.contents()
.each(
function()
{

var e = this,
$e = $(this);

Expand Down Expand Up @@ -178,15 +179,13 @@


// Truncate the text
var isTruncated = this._truncateNode( this.$inner );
var isTruncated = this._truncateNode( this.$dot );
this.$dot[ isTruncated ? 'addClass' : 'removeClass' ]( _c.truncated );


// Unwrap text from the temporarely node
this.$inner
.find( '*' )
.add( this.$inner )
.filter( '.' + _c.text )
.find( '.' + _c.text )
.each(
function()
{
Expand All @@ -197,9 +196,7 @@

// Remove "keep" class
this.$inner
.find( '*' )
.add( this.$inner )
.filter( '.' + _c.keep )
.find( '.' + _c.keep )
.removeClass( _c.keep );


Expand Down

0 comments on commit 2706163

Please sign in to comment.