]> git.mxchange.org Git - friendica.git/commitdiff
Add autosize call for all external textarea value changes
authorHypolite Petovan <mrpetovan@gmail.com>
Wed, 19 Apr 2017 02:04:23 +0000 (22:04 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Wed, 19 Apr 2017 02:04:23 +0000 (22:04 -0400)
js/acl.js
js/autocomplete.js
js/main.js
view/theme/frio/js/textedit.js
view/theme/frio/js/theme.js

index 4924ac12895b9273b8a62123e4da71a5b56067f1..054f5096026f96b222bcd9134807b1e8d0d67650 100644 (file)
--- a/js/acl.js
+++ b/js/acl.js
@@ -65,7 +65,7 @@ ACL.prototype.add_mention = function(id) {
        if (this.element.val().indexOf( searchText) >= 0 ) {
                return;
        }
-       this.element.val(searchText + this.element.val());
+       this.element.val(searchText + this.element.val()).trigger('change');
 }
 
 ACL.prototype.on_submit = function(){
index 8702abbcf92e3b23b3522a2655a827eb6bd2d3bd..3ed9fa30f9f2b23ae3007dda2348b0c9bb963abd 100644 (file)
@@ -166,7 +166,7 @@ function listNewLineAutocomplete(id) {
        if (word != null) {
                var textBefore = text.value.substring(0, caretPos);
                var textAfter  = text.value.substring(caretPos, text.length);
-               $('#' + id).val(textBefore + '\r\n[*] ' + textAfter);
+               $('#' + id).val(textBefore + '\r\n[*] ' + textAfter).trigger('change');
                setCaretPosition(text, caretPos + 5);
                return true;
        }
index c85aab4a2786ec74446a00b3695c106f7f424d2f..5df33ed590c8f0000286cf86144c3c10697b89a7 100644 (file)
                        var start = textarea.selectionStart;
                        var end = textarea.selectionEnd;
                        textarea.value = textarea.value.substring(0, start) + bbcode + textarea.value.substring(end, textarea.value.length);
+                       $(textarea).trigger('change');
                });
 
 
index d212ee0038ee7d2d35e065ba0c9a0be0a024e47b..8794658dd6911ff8ac74ecc755f4eab9c79a0183 100644 (file)
@@ -30,6 +30,8 @@ function insertFormatting(BBcode,id) {
                }
        }
 
+       $(textarea).trigger('change');
+
        return true;
 }
 
index 27dd296e5f4036ce3c23e9360810de6adbdf071b..41a437de7d6a0fa4d802685add56475da033e0c2 100644 (file)
@@ -300,6 +300,13 @@ $(document).ready(function(){
                });
        });
 
+       /*
+        * This event listeners ensures that the textarea size is updated event if the
+        * value is changed externally (textcomplete, insertFormatting, fbrowser...)
+        */
+       $(document).on('change', 'textarea', function(event) {
+               autosize.update(event.target);
+       });
 });
 
 function openClose(theID) {