Skip to content

Commit

Permalink
Incorrect word countdown fix
Browse files Browse the repository at this point in the history
Fix for issue #26
  • Loading branch information
ractoon committed Apr 9, 2017
1 parent bbde3a2 commit 810c3a6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 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-text-counter",
"version": "0.6.0",
"version": "0.6.1",
"main": "textcounter.js",
"license": "MIT",
"ignore": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"minimum",
"maximum"
],
"version": "0.6.0",
"version": "0.6.1",
"author": {
"name": "ractoon",
"url": "http://www.ractoon.com"
Expand Down
2 changes: 1 addition & 1 deletion textcounter.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"minimum",
"maximum"
],
"version": "0.6.0",
"version": "0.6.1",
"author": {
"name": "ractoon",
"url": "http://www.ractoon.com"
Expand Down
6 changes: 3 additions & 3 deletions textcounter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery Text Counter Plugin v0.6.0
* jQuery Text Counter Plugin v0.6.1
* https://github.com/ractoon/jQuery-Text-Counter
*
* Copyright 2014 ractoon
Expand Down Expand Up @@ -118,7 +118,7 @@
}

if (base.options.max !== -1) { // if a maximum value has been set
if (textCount >= base.options.max && base.options.max != 0) {
if (textCount >= base.options.max && base.options.max !== 0) {
// TextCounter: maxcount(el) Callback
base.options.maxcount(base.el);

Expand All @@ -132,7 +132,7 @@
// iterate over individual words
while (i < wordArray.length) {
// if over the maximum words allowed break;
if (i >= base.options.max - 1) break;
if (i >= base.options.max) break;

if (wordArray[i] !== undefined) {
trimmedString += wordArray[i] + ' ';
Expand Down
4 changes: 2 additions & 2 deletions textcounter.min.js

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

0 comments on commit 810c3a6

Please sign in to comment.