]> git.mxchange.org Git - friendica.git/commitdiff
[frio] Fix comment box not opening on focus, undefined on blur
authorHypolite Petovan <ben.lort@gmail.com>
Thu, 16 Feb 2017 12:06:11 +0000 (07:06 -0500)
committerHypolite Petovan <ben.lort@gmail.com>
Thu, 16 Feb 2017 12:06:11 +0000 (07:06 -0500)
- Remove the callback system for commentOpenUI
- Remove comments

Fixes #3062

view/theme/frio/js/textedit.js
view/theme/frio/js/theme.js

index 9c5c1823d1b624c1c295e08b963b075e6d53a91c..9226646b7be1d50c2f7cfb7c572e7627cbb8a56f 100644 (file)
@@ -81,39 +81,25 @@ function showHideCommentBox(id) {
 }
 
 function commentOpenUI(obj, id) {
-       $(document).unbind( "click.commentOpen", handler );
-
-       var handler = function() {
-               if (obj.value == '') {
-                       $("#comment-edit-text-" + id).addClass("comment-edit-text-full").removeClass("comment-edit-text-empty");
-                       // Choose an arbitrary tab index that's greater than what we're using in jot (3 of them)
-                       // The submit button gets tabindex + 1
-                       $("#comment-edit-text-" + id).attr('tabindex','9');
-                       $("#comment-edit-submit-" + id).attr('tabindex','10');
-                       $("#comment-edit-submit-wrapper-" + id).show();
-                       // initialize autosize for this comment
-                       autosize($("#comment-edit-text-" + id + ".text-autosize"));
-               }
-       };
-
-       $(document).bind( "click.commentOpen", handler );
+       $("#comment-edit-text-" + id).addClass("comment-edit-text-full").removeClass("comment-edit-text-empty");
+       // Choose an arbitrary tab index that's greater than what we're using in jot (3 of them)
+       // The submit button gets tabindex + 1
+       $("#comment-edit-text-" + id).attr('tabindex','9');
+       $("#comment-edit-submit-" + id).attr('tabindex','10');
+       $("#comment-edit-submit-wrapper-" + id).show();
+       // initialize autosize for this comment
+       autosize($("#comment-edit-text-" + id + ".text-autosize"));
 }
 
 function commentCloseUI(obj, id) {
-       $(document).unbind( "click.commentClose", handler );
-
-       var handler = function() {
-               if (obj.value === '') {
-                       $("#comment-edit-text-" + id).removeClass("comment-edit-text-full").addClass("comment-edit-text-empty");
-                       $("#comment-edit-text-" + id).removeAttr('tabindex');
-                       $("#comment-edit-submit-" + id).removeAttr('tabindex');
-                       $("#comment-edit-submit-wrapper-" + id).hide();
-                       // destroy the automatic textarea resizing
-                       autosize.destroy($("#comment-edit-text-" + id + ".text-autosize"));
-               }
-       };
-
-       $(document).bind( "click.commentClose", handler );
+       if (obj.value === '') {
+               $("#comment-edit-text-" + id).removeClass("comment-edit-text-full").addClass("comment-edit-text-empty");
+               $("#comment-edit-text-" + id).removeAttr('tabindex');
+               $("#comment-edit-submit-" + id).removeAttr('tabindex');
+               $("#comment-edit-submit-wrapper-" + id).hide();
+               // destroy the automatic textarea resizing
+               autosize.destroy($("#comment-edit-text-" + id + ".text-autosize"));
+       }
 }
 
 function jotTextOpenUI(obj) {
index 8102e7ac95614ef10a45cd5624b5b6d9a125059a..1695165e672a3f47e0037a47fb0e7dca853daea9 100644 (file)
@@ -10,7 +10,7 @@ $(document).ready(function(){
                        $("#back-to-top").fadeOut();
                }
        });
+
        // scroll body to 0px on click
        $("#back-to-top").click(function () {
                $("body,html").animate({
@@ -54,7 +54,7 @@ $(document).ready(function(){
        }
 
        // make responsive tabmenu with flexmenu.js
-       // the menupoints which doesn't fit in the second nav bar will moved to a 
+       // the menupoints which doesn't fit in the second nav bar will moved to a
        // dropdown menu. Look at common_tabs.tpl
        $("ul.tabs.flex-nav").flexMenu({
                'cutoff': 2,
@@ -82,17 +82,17 @@ $(document).ready(function(){
                                return false;
                        }
                });
-               
+
                if(checked == true) {
                        $("a#item-delete-selected").fadeTo(400, 1);
                        $("a#item-delete-selected").show();
                } else {
                        $("a#item-delete-selected").fadeTo(400, 0, function(){
                                $("a#item-delete-selected").hide();
-                       });     
+                       });
                }
        });
-               
+
        //$('ul.flex-nav').flexMenu();
 
        // initialize the bootstrap tooltips
@@ -128,7 +128,7 @@ $(document).ready(function(){
                // append the new heading to the navbar
                $("#topbar-second > .container > #tabmenu").append(newText);
 
-               // try to get the value of the original search input to insert it 
+               // try to get the value of the original search input to insert it
                // as value in the nav-search-input
                var searchValue = $("#search-wrapper .form-group-search input").val();
 
@@ -257,39 +257,6 @@ $(document).ready(function(){
        });
 
 });
-//function commentOpenUI(obj, id) {
-//     $(document).unbind( "click.commentOpen", handler );
-//
-//     var handler = function() {
-//             if(obj.value == '{{$comment}}') {
-//                     obj.value = '';
-//                     $("#comment-edit-text-" + id).addClass("comment-edit-text-full").removeClass("comment-edit-text-empty");
-//                     // Choose an arbitrary tab index that's greater than what we're using in jot (3 of them)
-//                     // The submit button gets tabindex + 1
-//                     $("#comment-edit-text-" + id).attr('tabindex','9');
-//                     $("#comment-edit-submit-" + id).attr('tabindex','10');
-//                     $("#comment-edit-submit-wrapper-" + id).show();
-//             }
-//     };
-//
-//     $(document).bind( "click.commentOpen", handler );
-//}
-//
-//function commentCloseUI(obj, id) {
-//     $(document).unbind( "click.commentClose", handler );
-//
-//     var handler = function() {
-//             if(obj.value === '') {
-//             obj.value = '{{$comment}}';
-//                     $("#comment-edit-text-" + id).removeClass("comment-edit-text-full").addClass("comment-edit-text-empty");
-//                     $("#comment-edit-text-" + id).removeAttr('tabindex');
-//                     $("#comment-edit-submit-" + id).removeAttr('tabindex');
-//                     $("#comment-edit-submit-wrapper-" + id).hide();
-//             }
-//     };
-//
-//     $(document).bind( "click.commentClose", handler );
-//}
 
 function openClose(theID) {
        var elem = document.getElementById(theID);