Skip to content

Commit c9348de

Browse files
committed
2 parents 09034d5 + b276172 commit c9348de

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,4 @@ init : function(el){} // Callback: func
169169
- [diptopol](https://github.com/diptopol) - `stopInputAtMaximum` with `twoCharCarriageReturn` count fix, trimmed newline calculation fix, maximum text reached condition fix, text count overflow notification
170170
- [trevorloflin](https://github.com/trevorloflin) - `minDisplayCutoff` and `maxDisplayCutoff` options
171171
- [t3mujin](https://github.com/t3mujin) - autocustom support (maxlength workaround), text fixes
172+
- [goranmiric ](https://github.com/goranmiric) - accessibility enhancements

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.8.0",
3+
"version": "0.9.0",
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.8.0",
14+
"version": "0.9.0",
1515
"author": {
1616
"name": "ractoon",
1717
"url": "https://www.ractoon.com"

textcounter.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Text Counter Plugin v0.8.0
2+
* jQuery Text Counter Plugin v0.9.0
33
* https://github.com/ractoon/jQuery-Text-Counter
44
*
55
* Copyright 2014 ractoon
@@ -25,6 +25,7 @@
2525
var counterText = base.options.countDown ? base.options.countDownText : base.options.counterText,
2626
counterNum = base.options.countDown ? base.options.max : 0,
2727
$formatted_counter_text = $('<div/>').addClass(base.options.textCountMessageClass)
28+
.attr('aria-live', 'assertive').attr('aria-atomic', 'true')
2829
.html(counterText.replace('%d', '<span class="' + base.options.textCountClass + '">' + counterNum + '</span>')),
2930
$count_overflow_text = $('<div/>').addClass(base.options.countOverflowContainerClass);
3031

@@ -70,7 +71,7 @@
7071
}
7172
else if (base.options.max == 'autocustom') {
7273
var max = base.$el.attr(base.options.autoCustomAttr);
73-
74+
7475
if (typeof max !== 'undefined' && max !== false) {
7576
base.options.max = max;
7677
}
@@ -161,11 +162,11 @@
161162
base.clearErrors('max');
162163
}
163164
}
164-
165+
165166
// hide the counter if it doesn't meet either the minimum or maximum display cutoff
166167
if (base.options.minDisplayCutoff == -1 && base.options.maxDisplayCutoff == -1) {
167-
base.$container.show();
168-
} else if (textCount <= base.options.min + base.options.minDisplayCutoff) {
168+
base.$container.show();
169+
} else if (textCount <= base.options.min + base.options.minDisplayCutoff) {
169170
base.$container.show();
170171
} else if (base.options.max !== -1 && textCount >= base.options.max - base.options.maxDisplayCutoff) {
171172
base.$container.show();

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)