File tree Expand file tree Collapse file tree 5 files changed +19
-3
lines changed Expand file tree Collapse file tree 5 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * handles card click navigation with modifier key support
3+ * @param {Event } event - the click event
4+ * @param {string } url - the URL to navigate to
5+ */
6+ function handleCardClick ( event , url ) {
7+ if ( event . target . tagName === 'A' || event . target . closest ( 'a' ) ) {
8+ return ;
9+ }
10+ if ( event . ctrlKey || event . metaKey || event . shiftKey ) {
11+ window . open ( url , '_blank' ) ;
12+ return ;
13+ }
14+ window . location = url ;
15+ }
Original file line number Diff line number Diff line change 3636 < script src ="https://cdn.jsdelivr.net/npm/apexcharts "> </ script >
3737 < script src ="{% static 'js/theme_handling.js' %} "> </ script >
3838 < script src ="{% static 'js/scroll-to-link.js' %} " defer > </ script >
39+ < script src ="{% static 'js/utils.js' %} "> </ script >
3940 < script src ="{% static 'js/boost-gecko/main.C3hPHS6-.js' %} " defer > </ script >
4041 {% block extra_head %}
4142 < link href ="{% static 'css/styles.css' %} " rel ="stylesheet ">
Original file line number Diff line number Diff line change 11< tr class ="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-200 ease-in-out cursor-pointer "
2- onclick ="window.location= '{% url 'library-detail' library_slug=library_version.library.slug version_slug=version_str %}' ">
2+ onclick ="handleCardClick(event, '{% url 'library-detail' library_slug=library_version.library.slug version_slug=version_str %}') ">
33 < td class ="py-2 align-top md:w-1/5 ">
44 < a class ="mr-1 font-bold capitalize text-sky-600 dark:text-sky-300 hover:text-orange dark:hover:text-orange "
55 href ="{% url 'library-detail' library_slug=library_version.library.slug version_slug=version_str %} "
Original file line number Diff line number Diff line change 22{% load date_filters %}
33
44< div class ="relative content-between p-3 bg-white md:rounded-lg md:shadow-lg md:p-5 dark:bg-charcoal hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-200 ease-in-out cursor-pointer "
5- onclick ="window.location= '{% url 'library-detail' library_slug=library_version.library.slug version_slug=version_str %}' ">
5+ onclick ="handleCardClick(event, '{% url 'library-detail' library_slug=library_version.library.slug version_slug=version_str %}') ">
66 < div class ="">
77 < h3 class ="pb-2 text-xl md:text-2xl capitalize border-b border-gray-700 ">
88 < div class ="flex justify-between ">
Original file line number Diff line number Diff line change 11< tr class ="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-300 ease-in-out cursor-pointer "
2- onclick ="window.location= '{% url 'library-detail' library_slug=library_version.library.slug version_slug=version_str %}' ">
2+ onclick ="handleCardClick(event, '{% url 'library-detail' library_slug=library_version.library.slug version_slug=version_str %}') ">
33 < td class ="align-top md:w-1/5 pt-3 ">
44 < a class ="mr-1 pl-1 font-bold capitalize text-sky-600 dark:text-sky-300 hover:text-orange dark:hover:text-orange "
55 href ="{% url 'library-detail' library_slug=library_version.library.slug version_slug=version_str %} "> {{ library_version.library.name }}</ a >
You can’t perform that action at this time.
0 commit comments