mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
1 line
482 B
JavaScript
1 line
482 B
JavaScript
define(["jquery"],function(a){var b={ELEMENT:"[data-auto-rows]"},c={ROW_CHANGE:"autorows:rowchange"},d=function(a){var b=a.attr("rows"),c=a.attr("data-max-rows"),d=a.height(),e=a.innerHeight(),f=e-d;a.height("1px");var g=a[0].scrollHeight,h=(g-f)/(d/b);return a.css("height",""),c&&h>=c?c:h},e=function(e){a(e).on("input propertychange",b.ELEMENT,function(b){var f=a(b.target),g=f.attr("rows"),h=d(f);h!=g&&(f.attr("rows",h),a(e).trigger(c.ROW_CHANGE))})};return{init:e,events:c}}); |