Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltipfix #49

Open
wants to merge 3 commits into
base: glossary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions assets/dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"/scripts/paged.polyfill.js": "/scripts/paged.polyfill.js?id=bd2ed45552bef34efdc1",
"/scripts/anchor.js": "/scripts/anchor.js?id=b2cfec4ae2c6878c7083",
"/scripts/anchor.js": "/scripts/anchor.js?id=b8cbd932cb1338511465",
"/styles/catalog.css": "/styles/catalog.css?id=b4d78714ee50b66c97be",
"/styles/colors-pb.css": "/styles/colors-pb.css?id=c0853bc29e98317812aa",
"/styles/covergenerator.css": "/styles/covergenerator.css?id=ff7959394e65a69d3c1a",
Expand All @@ -15,30 +14,31 @@
"/styles/select2.css": "/styles/select2.css?id=7373e0d2a1e8dabab523",
"/styles/style-catalog.css": "/styles/style-catalog.css?id=1b990ad0f745d38311a3",
"/styles/theme-options.css": "/styles/theme-options.css?id=4e6fd1be2be2d103379e",
"/scripts/organize.js": "/scripts/organize.js?id=4887b08fae3767d10f38",
"/scripts/export.js": "/scripts/export.js?id=1972645598adeb8876db",
"/scripts/tooltip.js": "/scripts/tooltip.js?id=c9318948984f1232ae0b",
"/scripts/theme-options.js": "/scripts/theme-options.js?id=7f23ef3e314444ece5a6",
"/scripts/theme-lock.js": "/scripts/theme-lock.js?id=af8ae80397db6db52e8f",
"/scripts/textboxes.js": "/scripts/textboxes.js?id=2eaae7a700c04964ee13",
"/scripts/textboxes-legacy.js": "/scripts/textboxes-legacy.js?id=b76addac6e812a8f6346",
"/scripts/small-menu.js": "/scripts/small-menu.js?id=667b7e7f582b9be36bd9",
"/scripts/search-and-replace.js": "/scripts/search-and-replace.js?id=effb25cf0537cc6e38fb",
"/scripts/quicktags.js": "/scripts/quicktags.js?id=8080327451ed1959fd70",
"/scripts/post-visibility.js": "/scripts/post-visibility.js?id=c9431c429566329a42bb",
"/scripts/network-managers.js": "/scripts/network-managers.js?id=aaf3ece38f93e86fc562",
"/scripts/login.js": "/scripts/login.js?id=c6ac8e99148567a52ee0",
"/scripts/import.js": "/scripts/import.js?id=33b551e8f1831afbe99e",
"/scripts/organize.js": "/scripts/organize.js?id=d35af9c6179a28d11d90",
"/scripts/export.js": "/scripts/export.js?id=0daf81009d0086d5d6dd",
"/scripts/tooltip.js": "/scripts/tooltip.js?id=01120ae3cf14a792462b",
"/scripts/theme-options.js": "/scripts/theme-options.js?id=aa3d96b85b250ff8f14d",
"/scripts/theme-lock.js": "/scripts/theme-lock.js?id=39127e07ef1f9d90e7d1",
"/scripts/textboxes.js": "/scripts/textboxes.js?id=c3b24f77891c0cbb6e36",
"/scripts/textboxes-legacy.js": "/scripts/textboxes-legacy.js?id=3d3b37826e6c0a670ed2",
"/scripts/small-menu.js": "/scripts/small-menu.js?id=852bdbaa8ccb4b13f230",
"/scripts/search-and-replace.js": "/scripts/search-and-replace.js?id=0702a4fc50eb83829067",
"/scripts/quicktags.js": "/scripts/quicktags.js?id=edda977cd968a44699da",
"/scripts/post-visibility.js": "/scripts/post-visibility.js?id=3693348de02233b4be8e",
"/scripts/network-managers.js": "/scripts/network-managers.js?id=243a1a74f2db2ea10eb7",
"/scripts/login.js": "/scripts/login.js?id=5a037450ee75656ce155",
"/scripts/import.js": "/scripts/import.js?id=be8aca7bec675839ac5a",
"/scripts/glossary.js": "/scripts/glossary.js?id=dd12427240814ce52f61",
"/scripts/ftnref-convert.js": "/scripts/ftnref-convert.js?id=e6c7fa873a43af02cb50",
"/scripts/footnote.js": "/scripts/footnote.js?id=d9d9827ce9a09b7bf6f0",
"/scripts/cssanimations.js": "/scripts/cssanimations.js?id=5a575d837720f7002503",
"/scripts/covergenerator.js": "/scripts/covergenerator.js?id=26ebbf5451f810f01943",
"/scripts/color-picker.js": "/scripts/color-picker.js?id=472efe4169832026f864",
"/scripts/cloner.js": "/scripts/cloner.js?id=b512bb4cc7c23c0421e6",
"/scripts/catalog.js": "/scripts/catalog.js?id=0f931a1dae3dd7b8f2dc",
"/scripts/book-information.js": "/scripts/book-information.js?id=3dc7cd4757177e568848",
"/scripts/applyclass.js": "/scripts/applyclass.js?id=a9da26ce6226d7263c0f",
"/scripts/ftnref-convert.js": "/scripts/ftnref-convert.js?id=2a34ca0b1ff4ccb1b2b9",
"/scripts/footnote.js": "/scripts/footnote.js?id=984e4e5689c865079271",
"/scripts/cssanimations.js": "/scripts/cssanimations.js?id=6e82f5550b9fa18a4018",
"/scripts/covergenerator.js": "/scripts/covergenerator.js?id=493d02810c5ae3c30461",
"/scripts/color-picker.js": "/scripts/color-picker.js?id=e9375a96dd0ae47059b0",
"/scripts/cloner.js": "/scripts/cloner.js?id=2541e4298205c79e1469",
"/scripts/catalog.js": "/scripts/catalog.js?id=ea831a1b81df926549cf",
"/scripts/book-information.js": "/scripts/book-information.js?id=5cfc9f2bcde8676d762a",
"/scripts/applyclass.js": "/scripts/applyclass.js?id=f0a47f7661d1cd0688c3",
"/scripts/paged.polyfill.js": "/scripts/paged.polyfill.js?id=c4676be4c0023fadb0f7",
"/scripts/blockui.js": "/scripts/blockui.js?id=73a1435220f33aceff1c",
"/scripts/isotope.js": "/scripts/isotope.js?id=8896e082b3fa1738e2e2",
"/scripts/matchheight.js": "/scripts/matchheight.js?id=a4b580e5f6599aed3c62",
Expand All @@ -47,4 +47,4 @@
"/scripts/select2.js": "/scripts/select2.js?id=e66208e306a3e3b57128",
"/scripts/sidr.js": "/scripts/sidr.js?id=32495427b04ceeab5376",
"/scripts/table.js": "/scripts/table.js?id=b5a536303c64c0bffe75"
}
}
2 changes: 1 addition & 1 deletion assets/dist/scripts/paged.polyfill.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/dist/scripts/tooltip.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 22 additions & 7 deletions assets/src/scripts/tooltip.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
// This script is loaded when a user is on a books web view

( function () {
//todo: modify so it shows on click, not on hover

// make tooltip faster by disabling the show/hide animations
jQuery( 'a.tooltip' ).addClass( 'no-hover' ).tooltip( {
show: false,
hide: false,
} ).click( function () {
jQuery( this ).tooltip();
// Show the tooltip
jQuery( document ).on( 'click', '.tooltip', function () {
jQuery( this ).addClass( 'on' );
jQuery( this ).tooltip( {
items: '.tooltip.on',
show: false,
hide: false,
position: {
my: 'center bottom',
at: 'center top',
},
} );
jQuery( this ).trigger( 'mouseenter' );
} );
// Hide the tooltip
jQuery( document ).on( 'click', '.tooltip.on', function () {
jQuery( this ).tooltip( 'close' );
jQuery( this ).removeClass( 'on' );
} );
//prevent mouseout and other related events from firing their handlers
jQuery( '.tooltip' ).on( 'mouseout', function ( e ) {
e.stopImmediatePropagation();
} );

} )();
2 changes: 1 addition & 1 deletion inc/shortcodes/glossary/class-glossary.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function glossaryTooltip( $term_id, $content ) {
// use our post instead of the global $post object
setup_postdata( $terms );

$html = '<a href="#" class="tooltip" title="' . get_the_excerpt() . '">' . $content . '</a>';
$html = '<a href="javascript:void(0);" class="tooltip" title="' . get_the_excerpt() . '">' . $content . '</a>';

// reset post data
wp_reset_postdata();
Expand Down