/* show Sone menu when hovering over the avatar. */
$(postElement).find(".post-avatar").mouseover(function() {
- $(".sone-menu:visible").fadeOut();
- $(".sone-post-menu", postElement).mouseleave(function() {
- $(this).fadeOut();
- }).fadeIn();
- return false;
+ if (typeof currentSoneMenuTimeoutHandler != undefined) {
+ clearTimeout(currentSoneMenuTimeoutHandler);
+ }
+ currentSoneMenuId = getPostId(this);
+ currentSoneMenuTimeoutHandler = setTimeout(function() {
+ $(".sone-menu:visible").fadeOut();
+ $(".sone-post-menu", postElement).mouseleave(function() {
+ $(this).fadeOut();
+ }).fadeIn();
+ }, 1000);
+ }).mouseleave(function() {
+ if (currentSoneMenuId = getPostId(this)) {
+ clearTimeout(currentSoneMenuTimeoutHandler);
+ }
});
(function(postElement) {
var soneId = $(".sone-menu-id", postElement).text();
/* show Sone menu when hovering over the avatar. */
$(replyElement).find(".reply-avatar").mouseover(function() {
- $(".sone-menu:visible").fadeOut();
- $(".sone-reply-menu", replyElement).mouseleave(function() {
- $(this).fadeOut();
- }).fadeIn();
- return false;
+ if (typeof currentSoneMenuTimeoutHandler != undefined) {
+ clearTimeout(currentSoneMenuTimeoutHandler);
+ }
+ currentSoneMenuId = getPostId(this) + "-" + getReplyId(this);
+ currentSoneMenuTimeoutHandler = setTimeout(function() {
+ $(".sone-menu:visible").fadeOut();
+ $(".sone-reply-menu", replyElement).mouseleave(function() {
+ $(this).fadeOut();
+ }).fadeIn();
+ }, 1000);
+ }).mouseleave(function() {
+ if (currentSoneMenuId = getPostId(this) + "-" + getReplyId(this)) {
+ clearTimeout(currentSoneMenuTimeoutHandler);
+ }
});
(function(replyElement) {
var soneId = $(".sone-menu-id", replyElement).text();
var initiallyLoggedIn = $("#sone #loggedIn").text() == "true";
var notLoggedIn = !initiallyLoggedIn;
+/** ID of the next-to-show Sone context menu. */
+var currentSoneMenuId;
+
+/** Timeout handler for the next-to-show Sone context menu. */
+var currentSoneMenuTimeoutHandler;
+
$(document).ready(function() {
/* this initializes the status update input field. */