-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename duplicated JS function toggleTooltip
A JS function named toggleTooltip already existed in another JS file. So the function is renamed to toggleCollapsibleTooltip and the classes are renamed accordingly.
- Loading branch information
Showing
5 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
14 changes: 7 additions & 7 deletions
14
src/api/app/assets/javascripts/webui/new_watchlist/collapsible_tooltip.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
function toggleTooltip() { // jshint ignore:line | ||
$('.toggle-tooltip').on('click', function(){ | ||
function toggleCollapsibleTooltip() { // jshint ignore:line | ||
$('.collapsible-tooltip').on('click', function(){ | ||
var replaceTitle = $(this).attr('title') === 'Click to keep it open' ? 'Click to close it' : 'Click to keep it open'; | ||
var infoContainer = $(this).parents('.toggle-tooltip-parent').next(); | ||
var infoContainer = $(this).parents('.collapsible-tooltip-parent').next(); | ||
$(infoContainer).toggleClass('collapsed'); | ||
$(infoContainer).removeClass('hover'); | ||
$(this).attr('title', replaceTitle); | ||
}); | ||
$('.toggle-tooltip').on('mouseover', function(){ | ||
$(this).parents('.toggle-tooltip-parent').next().addClass('hover'); | ||
$('.collapsible-tooltip').on('mouseover', function(){ | ||
$(this).parents('.collapsible-tooltip-parent').next().addClass('hover'); | ||
}); | ||
$('.toggle-tooltip').on('mouseout', function(){ | ||
$(this).parents('.toggle-tooltip-parent').next().removeClass('hover'); | ||
$('.collapsible-tooltip').on('mouseout', function(){ | ||
$(this).parents('.collapsible-tooltip-parent').next().removeClass('hover'); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters