Skip to content

Commit cf6335d

Browse files
authored
Merge pull request #5 from vsilva472/develop
Fix #4
2 parents 092341b + 87e20ee commit cf6335d

4 files changed

+10
-3
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ You can also change the separator `/` to wherever symbol or word you want. In th
9191

9292
### Changelog
9393

94+
1.0.1 - 2019-04-12
95+
* Fix #4 Maxlength
96+
9497
1.0.0 - 2018-12-02
9598
* Initial Commit
9699

dist/jquery-ensure-max-length.min.js

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

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ <h2>Specifying where to append the counter element</h2>
232232
<footer>
233233
<div class="container">
234234
<div class="row">
235-
<div class="col-xs-12 text-muted text-right">MIT - Version 1.0.0</div>
235+
<div class="col-xs-12 text-muted text-right">MIT - Version 1.0.1</div>
236236
</div>
237237
</div>
238238
</footer>

src/jquery-ensure-max-length.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@
1717
var _self = this;
1818

1919
this.showCount();
20-
20+
this.addMaxlengthAttribute();
2121
this.element.on( 'keyup blur', function () {
2222
_self.checkLength.call( _self, this );
2323
});
2424
};
2525

26+
Plugin.prototype.addMaxlengthAttribute = function () {
27+
this.element.attr('maxlength', this.options.limit);
28+
};
29+
2630
Plugin.prototype.showCount = function () {
2731
if ( this.options.placement ) this.$counter.appendTo( this.options.placement );
2832
else this.$counter.insertAfter( this.element );

0 commit comments

Comments
 (0)