Skip to content

Commit

Permalink
shortcut icon => icon
Browse files Browse the repository at this point in the history
follows up ea52c02 and 7941b6c

Fixes "undefined" error.
TBH I'm not sure whether "favicon reload" is working as intended, but at
least no error is happening now...
  • Loading branch information
amatsuda committed Sep 3, 2024
1 parent 37f8470 commit e0ebe4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ $(document).ready(function () {
// Make sure tabs don't get ugly focus borders when active
$('.group_tabs').on('focus', 'a', function () { $(this).blur(); });

var favicon_path = $('link[rel="shortcut icon"]').attr('href');
var favicon_path = $('link[rel="icon"]').attr('href');
$('.group_tabs').on('click', 'a', function () {
if (!$(this).parent().hasClass('active')) {
$('.group_tabs a').parent().removeClass('active');
Expand All @@ -114,8 +114,8 @@ $(document).ready(function () {

// Force favicon reload - otherwise the location change containing anchor would drop the favicon...
// Works only on firefox, but still... - Anyone know a better solution to force favicon on local file?
$('link[rel="shortcut icon"]').remove();
$('head').append('<link rel="shortcut icon" type="image/png" href="' + favicon_path + '" />');
$('link[rel="icon"]').remove();
$('head').append('<link rel="icon" type="image/png" href="' + favicon_path + '" />');
};
return false;
});
Expand Down
Loading

0 comments on commit e0ebe4c

Please sign in to comment.