Skip to content

Commit

Permalink
truncate fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FrDH committed Feb 2, 2018
1 parent 4871b65 commit 90a9eb6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 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.2.1",
"version" : "3.2.2",
"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.2.1",
"version" : "3.2.2",
"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.2.1",
"version" : "3.2.2",
"main" : "dist/jquery.dotdotdot.js",
"author" : "Fred Heusschen <[email protected]>",
"license" : "CC-BY-NC-4.0",
Expand Down
12 changes: 8 additions & 4 deletions src/jquery.dotdotdot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery dotdotdot 3.2.1
* jQuery dotdotdot 3.2.2
* @requires jQuery 1.7.0 or later
*
* dotdotdot.frebsite.nl
Expand All @@ -15,7 +15,7 @@
'use strict';

var _PLUGIN_ = 'dotdotdot';
var _VERSION_ = '3.2.1';
var _VERSION_ = '3.2.2';

if ( $[ _PLUGIN_ ] && $[ _PLUGIN_ ].version > _VERSION_ )
{
Expand Down Expand Up @@ -129,8 +129,12 @@


// Truncate the text
var isTruncated = !this._fits();
this._truncateToNode( this.$inner[ 0 ] );
var isTruncated = false;
if ( !this._fits() )
{
isTruncated = true;
this._truncateToNode( this.$inner[ 0 ] );
}

this.$dot[ isTruncated ? 'addClass' : 'removeClass' ]( _c.truncated );

Expand Down

0 comments on commit 90a9eb6

Please sign in to comment.