move functions up one scope

This commit is contained in:
Eliot Whalan 2016-06-24 16:38:45 +10:00
parent 62fc210f95
commit 986a0fcd16
No known key found for this signature in database
GPG Key ID: C0A42175139840D6
1 changed files with 5 additions and 5 deletions

View File

@ -52,13 +52,13 @@
<script src="https://cdn.jsdelivr.net/bootstrap.material-design/0.5.10/js/ripples.min.js" integrity="sha256-TY/EO/++Ug/P+fSBjaqlmtuphCBKwlP7TOnS+SGnN8g=" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/bootstrap.material-design/0.5.10/js/ripples.min.js" integrity="sha256-TY/EO/++Ug/P+fSBjaqlmtuphCBKwlP7TOnS+SGnN8g=" crossorigin="anonymous"></script>
<script> <script>
$.material.init(); $.material.init();
jQuery.each(jQuery('textarea[data-autoresize]'), function() {
var offset = this.offsetHeight - this.clientHeight; var offset = this.offsetHeight - this.clientHeight;
var resizeTextarea = function(el) { var resizeTextarea = function(el) {
jQuery(el).css('height', 'auto').css('height', el.scrollHeight + offset); jQuery(el).css('height', 'auto').css('height', el.scrollHeight + offset);
}; };
jQuery.each(jQuery('textarea[data-autoresize]'), function() {
jQuery(this).on('keyup input', function() { resizeTextarea(this); }); jQuery(this).on('keyup input', function() { resizeTextarea(this); });
}); });