From a1b35fb7d13c610ac6923e6162dd163312160c9a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 5 Jan 2017 17:40:45 +0100 Subject: 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 --- view/css/widgets.css | 3 ++- view/php/default.php | 2 +- view/theme/redbasic/js/redbasic.js | 4 +++- view/tpl/notes.tpl | 7 ++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/view/css/widgets.css b/view/css/widgets.css index abaf03038..9b97d8bf7 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -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 */ diff --git a/view/php/default.php b/view/php/default.php index 839a36b5b..373fa2fd0 100644 --- a/view/php/default.php +++ b/view/php/default.php @@ -10,7 +10,7 @@
- +
diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 185dc7bcd..4194b8f25 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -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' }); } diff --git a/view/tpl/notes.tpl b/view/tpl/notes.tpl index f9fed1feb..c4da3783b 100644 --- a/view/tpl/notes.tpl +++ b/view/tpl/notes.tpl @@ -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) -- cgit v1.2.3 From 3e0ea9727fd73daafea5597e76fab8eed252f215 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 5 Jan 2017 17:54:44 +0100 Subject: same fix for mobile view --- view/theme/redbasic/js/redbasic.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 4194b8f25..3ff0c43ae 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -107,7 +107,9 @@ function toggleAside() { $('main').addClass('region_1-on') $('
').appendTo('section'); $('#left_aside_wrapper').stick_in_parent({ - offset_top: $('nav').outerHeight(true) - 10 + offset_top: $('nav').outerHeight(true) - 10, + parent: '#region_1', + spacer: '#left_aside_spacer' }); } } -- cgit v1.2.3