fix an issue with sticky_kit where input fields and textareas would blur on recalc. auto resize the notes textarea since if it sticks to the bottom it can not be properly resized

This commit is contained in:
Mario Vavti 2017-01-05 17:40:45 +01:00
parent 0364bf4913
commit a1b35fb7d1
4 changed files with 10 additions and 6 deletions

View File

@ -64,8 +64,9 @@ li:hover .widget-nav-pills-icons {
#note-text {
padding: 5px;
width: 100%;
resize: vertical;
resize: none;
min-height: 250px;
overflow: hidden;
}
/* saved searches */

View File

@ -10,7 +10,7 @@
<header><?php if(x($page,'header')) echo $page['header']; ?></header>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"><?php if(x($page,'nav')) echo $page['nav']; ?></nav>
<main>
<aside id="region_1"><div id="left_aside_wrapper"><?php if(x($page,'aside')) echo $page['aside']; ?></div></aside>
<aside id="region_1"><div id="left_aside_spacer"><div id="left_aside_wrapper"><?php if(x($page,'aside')) echo $page['aside']; ?></div></div></aside>
<section id="region_2"><?php if(x($page,'content')) echo $page['content']; ?>
<div id="page-footer"></div>
<div id="pause"></div>

View File

@ -18,7 +18,9 @@ $(document).ready(function() {
if($(window).width() > 767) {
$('#left_aside_wrapper').stick_in_parent({
offset_top: $('nav').outerHeight(true)
offset_top: $('nav').outerHeight(true),
parent: '#region_1',
spacer: '#left_aside_spacer'
});
}

View File

@ -5,9 +5,10 @@
var noteSaveTimer = null;
var noteText = $('#note-text');
$(document).ready(function(){
noteText.height(noteText[0].scrollHeight);
});
noteText.on('change keyup keydown paste cut', function () {
$(this).height(0).height(this.scrollHeight);
$(document.body).trigger("sticky_kit:recalc");
}).change();
$(document).on('focusout',"#note-text",function(e){
if(noteSaveTimer)