]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/media/js/osqa.main.js
show information about the badge you just got in the message notification instead...
[osqa.git] / forum / skins / default / media / js / osqa.main.js
index 89a59ef83cc45b892494ff4ea21d0cf2b57936c1..0122c2576910865bfff2e7529358c252819d500d 100644 (file)
@@ -173,7 +173,7 @@ function show_dialog (extern) {
         $diag.fadeOut('fast', function() {\r
             $diag.remove();\r
         });\r
-    }\r
+    };\r
 \r
     var options = {\r
         extra_class: '',\r
@@ -201,7 +201,7 @@ function show_dialog (extern) {
         options.pos = {x: options.event.pageX, y: options.event.pageY};\r
     }\r
 \r
-    var html = '<div class="dialog ' + options.extra_class + '" style="display: none;">'\r
+    var html = '<div class="dialog ' + options.extra_class + '" style="display: none; z-index: 999;">'\r
              + '<div class="dialog-content">' + options.html + '</div><div class="dialog-buttons">';\r
 \r
     if (options.show_no) {\r
@@ -210,7 +210,8 @@ function show_dialog (extern) {
 \r
     html += '<button class="dialog-yes"' + copy_id + '>' + options.yes_text + '</button>' + '</div></div>';\r
 \r
-    $dialog = $(html);\r
+    var $dialog = $(html);\r
+\r
     $('body').append($dialog);\r
     var message = $('.dialog-content')[0];\r
     message.style.visibility = "hidden";\r
@@ -263,14 +264,20 @@ function show_dialog (extern) {
         message.style.visibility = "visible";\r
     });\r
 \r
-    $dialog.find('.dialog-no').click(function() {\r
-        default_close_function($dialog);\r
-    });\r
-\r
     $dialog.find('.dialog-yes').click(function() {\r
         options.yes_callback($dialog);\r
     });\r
 \r
+    if (options.hasOwnProperty("no_callback")) {\r
+        $dialog.find('.dialog-no:first-child').click(function() {\r
+            options.no_callback($dialog);\r
+        });\r
+    } else {\r
+        $dialog.find('.dialog-no:first-child').click(function() {\r
+            default_close_function($dialog);\r
+        });\r
+    }\r
+\r
     if (options.close_on_clickoutside) {\r
         $dialog.one('clickoutside', function() {\r
             default_close_function($dialog);\r