mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
hotspots.js: Refactor place_icon for clarity.
This commit is contained in:
@@ -52,7 +52,9 @@ exports.post_hotspot_as_read = function (hotspot_name) {
|
|||||||
function place_icon(hotspot) {
|
function place_icon(hotspot) {
|
||||||
var element = $(hotspot.location.element);
|
var element = $(hotspot.location.element);
|
||||||
var icon = $('#hotspot_' + hotspot.name + '_icon');
|
var icon = $('#hotspot_' + hotspot.name + '_icon');
|
||||||
if (element.length === 0) {
|
|
||||||
|
if (element.length === 0 || element.css('display') === 'none' ||
|
||||||
|
!element.is(':visible') || element.is(':hidden')) {
|
||||||
icon.css('display', 'none');
|
icon.css('display', 'none');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -66,13 +68,6 @@ function place_icon(hotspot) {
|
|||||||
top: client_rect.top + offset.top,
|
top: client_rect.top + offset.top,
|
||||||
left: client_rect.left + offset.left,
|
left: client_rect.left + offset.left,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (element.css('display') === 'none' ||
|
|
||||||
!element.is(':visible') ||
|
|
||||||
element.is(':hidden')) {
|
|
||||||
icon.css('display', 'none');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
icon.css('display', 'block');
|
icon.css('display', 'block');
|
||||||
icon.css(placement);
|
icon.css(placement);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user