]> git.mxchange.org Git - friendica.git/commitdiff
use height: 0 instead of display: none to hide jot sections
authorrabuzarus <>
Mon, 3 Apr 2017 11:38:07 +0000 (13:38 +0200)
committerrabuzarus <>
Mon, 3 Apr 2017 11:38:07 +0000 (13:38 +0200)
view/theme/frio/css/style.css
view/theme/frio/templates/jot-header.tpl
view/theme/frio/templates/jot.tpl

index b4497b5a6bb9d222aa145405b0be3d76274aea87..d72aa1abafe347b7166de9c7d8f00ba90908af5b 100644 (file)
@@ -91,6 +91,10 @@ blockquote {
 .hidden {
     display: none !important;
 }
+.minimize {
+    max-height: 0px !important;
+    overflow: hidden !important;
+}
 code {
     white-space: pre-wrap;
 }
index 27fc608e7cc0d1bde2196d7f2b1c290bc57b2e8f..6aad9889d1a0822f7b5d94a46bada87282cf1277 100644 (file)
        // the following functions show/hide the specific jot content
        // in dependence of the selected nav
        function aclActive() {
-               $(".modal-body #profile-jot-wrapper, .modal-body #jot-preview-content, .modal-body #jot-fbrowser-wrapper").hide();
-               $(".modal-body #profile-jot-acl-wrapper").show();
+               $(".modal-body #profile-jot-wrapper, .modal-body #jot-preview-content, .modal-body #jot-fbrowser-wrapper").addClass("minimize");
+               $(".modal-body #profile-jot-acl-wrapper").removeClass("minimize");
        }
 
 
        function previewActive() {
-               $(".modal-body #profile-jot-wrapper, .modal-body #profile-jot-acl-wrapper,.modal-body #jot-fbrowser-wrapper").hide();
-               preview_post();
+               $(".modal-body #profile-jot-wrapper, .modal-body #profile-jot-acl-wrapper,.modal-body #jot-fbrowser-wrapper").addClass("minimize");
+               var postPreview = preview_post();
+               if (postPreview && typeof postPreview !== "undefined") {
+                       $(".modal-body #jot-preview-content").removeClass("minimize");
+               }
        }
 
        function jotActive() {
-               $(".modal-body #profile-jot-acl-wrapper, .modal-body #jot-preview-content, .modal-body #jot-fbrowser-wrapper").hide();
-               $(".modal-body #profile-jot-wrapper").show();
+               $(".modal-body #profile-jot-acl-wrapper, .modal-body #jot-preview-content, .modal-body #jot-fbrowser-wrapper").addClass("minimize");
+               $(".modal-body #profile-jot-wrapper").removeClass("minimize");
 
                //make sure jot text does have really the active class (we do this because there are some
                // other events which trigger jot text
        }
 
        function fbrowserActive() {
-               $(".modal-body #profile-jot-wrapper, .modal-body #jot-preview-content, .modal-body #profile-jot-acl-wrapper").hide();
+               $(".modal-body #profile-jot-wrapper, .modal-body #jot-preview-content, .modal-body #profile-jot-acl-wrapper").addClass("minimize");
 
-               $(".modal-body #jot-fbrowser-wrapper").show();
+               $(".modal-body #jot-fbrowser-wrapper").removeClass("minimize");
 
                $(function() {Dialog.showJot();});
        }
index cd54580e36240b1bc4d07ce7ab6115d17cfd679f..75a0cbc0513ec0d60c2ac6fdaca5d19709ee18f1 100644 (file)
 
                                </div>
 
-                               <div id="profile-jot-acl-wrapper" style="display: none;">
+                               <div id="profile-jot-acl-wrapper" class="minimize">
                                        {{$acl}}
                                </div>
 
-                               <div id="jot-preview-content" style="display:none;"></div>
+                               <div id="jot-preview-content" class="minimize"></div>
                        </form>
 
-                       <div id="jot-fbrowser-wrapper" style="display: none"></div>
+                       <div id="jot-fbrowser-wrapper" class="minimize"></div>
 
                        {{if $content}}<script>initEditor();</script>{{/if}}
                </div>