Skip to content

Commit 810c3a6

Browse files
committed
Incorrect word countdown fix
Fix for issue #26
1 parent bbde3a2 commit 810c3a6

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery-text-counter",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"main": "textcounter.js",
55
"license": "MIT",
66
"ignore": [

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"minimum",
1212
"maximum"
1313
],
14-
"version": "0.6.0",
14+
"version": "0.6.1",
1515
"author": {
1616
"name": "ractoon",
1717
"url": "http://www.ractoon.com"

textcounter.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"minimum",
1010
"maximum"
1111
],
12-
"version": "0.6.0",
12+
"version": "0.6.1",
1313
"author": {
1414
"name": "ractoon",
1515
"url": "http://www.ractoon.com"

textcounter.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Text Counter Plugin v0.6.0
2+
* jQuery Text Counter Plugin v0.6.1
33
* https://github.com/ractoon/jQuery-Text-Counter
44
*
55
* Copyright 2014 ractoon
@@ -118,7 +118,7 @@
118118
}
119119

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

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

137137
if (wordArray[i] !== undefined) {
138138
trimmedString += wordArray[i] + ' ';

textcounter.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)