[livejournal] r18996: LJSV-1546: "mark spam" bubble positionin...
Committer: szhirkov
LJSV-1546: "mark spam" bubble positioningU trunk/htdocs/js/commentmanage.js
Modified: trunk/htdocs/js/commentmanage.js
===================================================================
--- trunk/htdocs/js/commentmanage.js 2011-04-27 10:20:40 UTC (rev 18995)
+++ trunk/htdocs/js/commentmanage.js 2011-04-27 10:30:00 UTC (rev 18996)
@@ -242,6 +242,10 @@
}
var canAdmin = LJ_cmtinfo.canAdmin;
+ var imageInTarget = jQuery(ae).find('img');
+
+ var markSpamMLPrefix = (Site.remote_is_maintainer == 1) ? 'comment.mark.spam.' : 'comment.mark.spam2.';
+
if (action == 'markAsSpam') {
if (!window.delPopup) {
window.delPopup = jQuery('<div />')
@@ -251,9 +255,9 @@
}
window.delPopup
- .html('<div class="b-popup-group"><div class="b-popup-row b-popup-row-head"><strong>' + getLocalizedStr('comment.mark.spam.title', comUser) + '</strong></div><div class="b-popup-row">' + getLocalizedStr('comment.mark.spam.subject', comUser) + '</div><div class="b-popup-row"><input type="button" class="spam-comment-button" onclick="deleteComment(' + dItemid + ', \'' + action + '\');" value="' + getLocalizedStr('comment.mark.spam.button', comUser) + '"></div><div>', ae, e, 'spamComment' + dItemid)
+ .html('<div class="b-popup-group"><div class="b-popup-row b-popup-row-head"><strong>' + getLocalizedStr(markSpamMLPrefix + 'title', comUser) + '</strong></div><div class="b-popup-row">' + getLocalizedStr(markSpamMLPrefix + 'subject', comUser) + '</div><div class="b-popup-row"><input type="button" class="spam-comment-button" onclick="deleteComment(' + dItemid + ', \'' + action + '\');" value="' + getLocalizedStr(markSpamMLPrefix + 'button', comUser) + '"></div><div>', ae, e, 'spamComment' + dItemid)
.bubble()
- .bubble('show', ae);
+ .bubble('show', (imageInTarget.length === 0) ? ae : imageInTarget);
return true;
} else if (action == 'delete') {
@@ -285,7 +289,7 @@
window.modPopup
.html(inHTML.join(' '))
.bubble()
- .bubble('show', ae);
+ .bubble('show', (imageInTarget.length === 0) ? ae : imageInTarget);
} else if (action == 'unspam') {
deleteComment(dItemid, action);
