Skip to content

Commit

Permalink
Remove messages from Favourites header
Browse files Browse the repository at this point in the history
  • Loading branch information
gcatanese committed Jan 3, 2024
1 parent 2c2cbe5 commit ea7f5da
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ function createFavourites() {
// Favourites title and helper messages
var divFavouritesContainer = $('<div>').addClass("divFavouritesContainer");
var h3 = $('<h3>').addClass("sectionTitle").text("Favourites");
// message when hovering over text
var copyToClipboardMessageSpan = $('<span>').attr('id', 'copyToClipboardMessageSpanId').addClass("hidden").text("Click to copy in the clipboard");
// message when text is copied
var textIsCopiedMessageSpan = $('<span>').attr('id', 'textIsCopiedMessageSpanId').addClass("hidden").html("Copied &#x2705;");
divFavouritesContainer.append(h3, copyToClipboardMessageSpan, textIsCopiedMessageSpan);
divFavouritesContainer.append(h3);

divFavourites.append(divFavouritesContainer);

Expand Down Expand Up @@ -207,20 +203,7 @@ function addCopyHandlers(element) {
// make it copyable
element.addClass("copyable");
// set handlers
element.hover(onHoverHandler).click(copyToClipboardHandler)
}

// when hovering over copiable text
// display helper message
function onHoverHandler() {
$(this).hover(function() {
if($('#textIsCopiedMessageSpanId').is(':visible')) {
return;
}
$('#copyToClipboardMessageSpanId').show();
}, function() {
$('#copyToClipboardMessageSpanId').hide();
});
element.click(copyToClipboardHandler)
}

// when copying into the clipboard
Expand Down

0 comments on commit ea7f5da

Please sign in to comment.