You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
var ComponentsBootstrapMaxlength = function () {
|
|
|
|
var handleBootstrapMaxlength = function() {
|
|
$('#maxlength_defaultconfig').maxlength({
|
|
limitReachedClass: "label label-danger",
|
|
})
|
|
|
|
$('#maxlength_thresholdconfig').maxlength({
|
|
limitReachedClass: "label label-danger",
|
|
threshold: 20
|
|
});
|
|
|
|
$('#maxlength_alloptions').maxlength({
|
|
alwaysShow: true,
|
|
warningClass: "label label-success",
|
|
limitReachedClass: "label label-danger",
|
|
separator: ' out of ',
|
|
preText: 'You typed ',
|
|
postText: ' chars available.',
|
|
validate: true
|
|
});
|
|
|
|
$('#maxlength_textarea').maxlength({
|
|
limitReachedClass: "label label-danger",
|
|
alwaysShow: true
|
|
});
|
|
|
|
$('#maxlength_placement').maxlength({
|
|
limitReachedClass: "label label-danger",
|
|
alwaysShow: true,
|
|
placement: App.isRTL() ? 'top-right' : 'top-left'
|
|
});
|
|
}
|
|
|
|
return {
|
|
//main function to initiate the module
|
|
init: function () {
|
|
handleBootstrapMaxlength();
|
|
}
|
|
};
|
|
|
|
}();
|
|
|
|
jQuery(document).ready(function() {
|
|
ComponentsBootstrapMaxlength.init();
|
|
});
|