hotspots: Move the code for closing hotspot icon to hotspots.js.

This commit is contained in:
Shubham Dhama
2018-03-18 00:05:19 +05:30
committed by Tim Abbott
parent e58534022e
commit 120ebc8f13
2 changed files with 10 additions and 6 deletions

View File

@@ -646,12 +646,7 @@ $(function () {
// open
$('body').on('click', '.hotspot-icon', function (e) {
// hide icon
$(this).animate({ opacity: 0 }, {
duration: 300,
done: function () {
$(this).css({ display: 'none' });
}.bind(this),
});
hotspots.close_hotspot_icon(this);
// show popover
var hotspot_name = $(e.target).closest('.hotspot-icon')

View File

@@ -207,6 +207,15 @@ exports.is_open = function () {
return $('.hotspot.overlay').hasClass('show');
};
exports.close_hotspot_icon = function (elem) {
$(elem).animate({ opacity: 0 }, {
duration: 300,
done: function () {
$(elem).css({ display: 'none' });
}.bind(elem),
});
};
exports.load_new = function (new_hotspots) {
new_hotspots.forEach(function (hotspot) {
hotspot.location = HOTSPOT_LOCATIONS[hotspot.name];