Newer
Older
/* global $ */
/* @depend TablesorterController.js */
var QfqNS = QfqNS || {};
$(document).ready( function () {
(function (n) {
var tablesorterController = new n.TablesorterController();
$('.tablesorter').each(function(i) {
tablesorterController.setup($(this), i);
}); // end .each()
$('.qfq-auto-grow').each(function() {
var newHeight = $(this).prop('scrollHeight');
var maxHeight = $(this).data('max-height') || 0;
if(newHeight < maxHeight || maxHeight === 0) {
$(this).height(newHeight);
} else {
$(this).height(maxHeight);
$('.qfq-auto-grow').on('input', function() {
var newHeight = $(this).prop('scrollHeight');
var maxHeight = $(this).data('max-height') || 0;
if($(this).height() + 10 < newHeight) {
if(newHeight < maxHeight || maxHeight === 0) {
$(this).height(newHeight);
}
}
});