]> git.mxchange.org Git - friendica.git/commitdiff
make profiles-menu disappear when clicked outside it
authorSimon L'nu <simon.lnu@gmail.com>
Fri, 16 Mar 2012 20:43:34 +0000 (16:43 -0400)
committerSimon L'nu <simon.lnu@gmail.com>
Fri, 16 Mar 2012 20:43:34 +0000 (16:43 -0400)
Signed-off-by: Simon L'nu <simon.lnu@gmail.com>
view/theme/dispy-dark/theme.php
view/theme/dispy/theme.php

index 0134b1f91b91c579bc1e82c62527bf4df840c04c..b57971db9695eb921337ea28f45b98ab5582b625 100644 (file)
@@ -73,6 +73,15 @@ $(document).ready(function() {
        $('#nav-notifications-linkmenu').click(function(event) {
                event.stopPropagation();
        });
+       // click outside profiles menu closes it
+       $('html').click(function() {
+               $('#profiles-menu-trigger').removeClass('selected');
+               document.getElementById("profiles-menu").style.display = "none";
+       });
+
+       $('#profiles-menu').click(function(event) {
+               event.stopPropagation();
+       });
 
        // main function in toolbar functioning
     function toggleToolbar() {
index ac97948a3885314e53cc84f8d3dc580c8c90ad8a..9f0fcba828f1e757c7cfc3e29c70ab42e478bd3d 100644 (file)
@@ -73,6 +73,15 @@ $(document).ready(function() {
        $('#nav-notifications-linkmenu').click(function(event) {
                event.stopPropagation();
        });
+       // click outside profiles menu closes it
+       $('html').click(function() {
+               $('#profiles-menu-trigger').removeClass('selected');
+               document.getElementById("profiles-menu").style.display = "none";
+       });
+
+       $('#profiles-menu').click(function(event) {
+               event.stopPropagation();
+       });
 
        // main function in toolbar functioning
     function toggleToolbar() {