Commits

reorx committed 329f7ab

toggle menu fixed

Comments (0)

Files changed (4)

static/css/general.css

 .clearfix {
     clear: both;
 }
+
+.hidden { display: none; }
+.active { display: inline; }

static/knowledge/js/base.js

         //_Area
         AREA.info = $('#InfoArea');
         AREA.operate_category = $('#operate_category');
+        AREA.k_menu_status = 0;
         function OperateArea_toggle() {
             AREA.operate_category.toggle();
             AREA.operate_knowledge.toggle();

templates/knowledge/base.html

     </div>
     <!---->
     <div id="loading">Loading..</div>
-    <div id="knowledgeMenu" style="display:none;">
-        <a href="#" id="" class="Button_KM" onclick="Content_EditPage();hideKnowledgeMenu()">Edit</a>
-        <a href="#" id="" class="Button_KM" onclick="Content_AddPage('child');hideKnowledgeMenu()">Chi</a>
-        <a href="#" id="" class="Button_KM" onclick="Content_AddPage('brother');hideKnowledgeMenu()">Bro</a>
-        <a href="#" id="" class="Button_KM" onclick="hideKnowledgeMenu()">Del</a>
+    <div id="knowledgeMenu" class="hidden">
+        <a href="#" id="" class="Button_KM" onclick="Content_EditPage();">Edit</a>
+        <a href="#" id="" class="Button_KM" onclick="Content_AddPage('child');">Chi</a>
+        <a href="#" id="" class="Button_KM" onclick="Content_AddPage('brother');">Bro</a>
+        <a href="#" id="" class="Button_KM" onclick="">Del</a>
     </div>
 </body>
 </html>

templates/knowledge/infoarea_knowledgelist.html

                         var Xpx,Ypx;
                         Xpx = (Number(e.pageX)+10)+'px';
                         Ypx = e.pageY+'px';
-                        $('#knowledgeMenu').css({
-                            display:'inline',
-                            left: Xpx,
-                            top: Ypx,
-                        });
-                        AREA.ifKMshow = 'true';
+                        $('#knowledgeMenu')
+                            .css({ left: Xpx, top: Ypx, })
+                            .toggleClass('hidden');
+                        return false;
                     }
                 });
             });
-
+    // body //
+    $('body').click(function(){
+        if (!$('#knowledgeMenu').is('.hidden')) {
+            $('#knowledgeMenu').addClass('hidden');
+        }
+    });
 </script>