Commit eaed08f7 authored by Fabio Montefuscolo's avatar Fabio Montefuscolo

[ENH] Let translantion field grow while user type

parent 71b2ff46
......@@ -3893,3 +3893,12 @@ $(document).ajaxComplete(function (e, jqxhr) {
return true;
});
});
$(document).on('keydown', 'textarea.autoheight', function(evt){
var el = this;
var height = Math.max(el.clientHeight, el.offsetHeight, el.scrollHeight);
el.style.cssText = 'height:' + height + 'px; overflow-y: hidden';
setTimeout(function(){
el.scrollTo(0,0);
}, 0);
}).on('ready', console.log.bind(console));
......@@ -141,7 +141,7 @@
<textarea id="tran_{$smarty.foreach.translations.index}"
name="tran_{$smarty.foreach.translations.index}"
tabindex="{$smarty.foreach.translations.index + 1}"
class="form-control" rows="2">{$item.tran|escape}</textarea>
class="form-control autoheight" rows="2">{$item.tran|escape}</textarea>
</div>
<div class="col-md-12">
......@@ -168,7 +168,7 @@
<option {if ! isset($item.general)}selected {/if}value="">{tr}Undecided{/tr}</option>
<option {if $item.general === true}selected {/if}value="general">{tr}Yes{/tr}</option>
<option {if $item.general === false}selected {/if}value="local">{tr}No{/tr}</option>
</select>
</select>]
</div>
{/if}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment