]> git.mxchange.org Git - friendica.git/blobdiff - js/main.js
catch comment format button also after ajax update
[friendica.git] / js / main.js
index d3cce33040a6d8fc53b0b635fbfa1eb3e19644ab..e1e852cbaf655935fce69142f87ca02c642e5c86 100644 (file)
                });*/
                
                /* setup comment textarea buttons */
-               
-               $('[data-role="insert-formatting"]').on('click', function(e) {
+               /* comment textarea buttons needs some "data-*" attributes to work:
+                *              data-role="insert-formatting" : to mark the element as a formatting button
+                *              data-comment="<string>" : string for "Comment", used by insertFormatting() function
+                *              data-bbcode="<string>" : name of the bbcode element to insert. insertFormatting() will insert it as "[name][/name]"
+                *              data-id="<string>" : id of the comment, used to find other comment-related element, like the textarea
+                * */           
+               $('body').on('click','[data-role="insert-formatting"]', function(e) {
                        e.preventDefault();
                        var o = $(this);
                        var comment = o.data('comment');