Skip to content

Commit

Permalink
Merge pull request #1338 from brockhaus/2022.12-rc
Browse files Browse the repository at this point in the history
Added ALT and TITLE of original IMG to fancybox popup.
  • Loading branch information
MrPetovan committed Dec 19, 2022
2 parents 4cdd24c + f829563 commit f922d69
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions fancybox/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### Version 1.05

* Added ALT and TITLE of original IMG to fancybox popup.

### Version 1.04

* Update supporting upcoming imnagegrid in posts

### Version 1.03

* imgages in body-attach with title / alt attribute get them removed while adding fancy attributes
Expand Down
8 changes: 8 additions & 0 deletions fancybox/asset/fancybox/fancybox.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@ $(document).ready(function() {
$.fancybox.defaults.loop = "true";
// this disables the colorbox hook found in frio/js/modal.js:34
$("body").off("click", ".wall-item-body a img");

// Adds ALT/TITLE text to fancybox
$('a[data-fancybox').fancybox({
afterLoad : function(instance, current) {
current.$image.attr('alt', current.opts.$orig.find('img').attr('alt') );
current.$image.attr('title', current.opts.$orig.find('img').attr('title') );
}
});
});
2 changes: 1 addition & 1 deletion fancybox/fancybox.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Name: Fancybox
* Description: Open media attachments of posts into a fancybox overlay.
* Version: 1.04
* Version: 1.05
* Author: Grischa Brockhaus <grischa@brockha.us>
*/

Expand Down

0 comments on commit f922d69

Please sign in to comment.