Skip to content

Commit

Permalink
Merge branch 'feature/3696_hoverIntent_tours' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Eardley committed Nov 23, 2023
2 parents ce2e11c + ba98620 commit aa8ef6b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
4 changes: 0 additions & 4 deletions cms/sass/components/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
}
}

.dropdown--notifications {
@extend .dropdown;
}

.dropdown__menu {
display: none;
padding: 0;
Expand Down
2 changes: 1 addition & 1 deletion portality/static/js/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ doaj.notifications.notificationsReceived = function(data) {
}

$(".notification_action_link").on("click", doaj.notifications.notificationClicked);
$(".dropdown--notifications").hoverIntent(doaj.notifications.showDropdown, doaj.notifications.hideDropdown);
$("#notifications_nav").hoverIntent(doaj.notifications.showDropdown, doaj.notifications.hideDropdown);
}

doaj.notifications.showDropdown = function(e) {
Expand Down
11 changes: 11 additions & 0 deletions portality/static/js/tourist.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ doaj.tourist.init = function(params) {
if (first) {
doaj.tourist.start(first);
}

$("#dropdown--tour_nav").hoverIntent(doaj.tourist.showDropdown, doaj.tourist.hideDropdown);
}

doaj.tourist.showDropdown = function(e) {
console.log("showDropdown` called")
$("#feature_tours").show();
}
doaj.tourist.hideDropdown = function() {
console.log("showDropdown` called")
$("#feature_tours").hide();
}

doaj.tourist.findNextTour = function() {
Expand Down
6 changes: 3 additions & 3 deletions portality/templates/includes/_tourist_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
{% set tours = tourservice.activeTours(request.path, current_user) %}

{% if tours|length > 0 %}
<li class="dropdown flex-center">
<span id="feature_tour_nav" class="dropdown__trigger label" role="button" aria-haspopup="true" aria-expanded="false">
<li class="dropdown flex-center" id="dropdown--tour_nav">
<a id="feature_tour_nav" class="dropdown__trigger label" role="button" aria-haspopup="true" aria-expanded="false">
<span><span data-feather="navigation" aria-hidden="true"></span> Feature Tours</span>
</span>
</a>
<ul class="dropdown__menu notifications" id="feature_tours">
{% for tour in tours %}
{% set seen = namespace(val="[new] ") %}
Expand Down
2 changes: 1 addition & 1 deletion portality/templates/layouts/dashboard_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2 class="sr-only">DOAJ Dashboard</h2>
<ul class="unstyled-list flex-center">
{% include "includes/_tourist_nav.html" %}
{# ~~->Notifications:Feature~~ #}
<li class="dropdown--notifications flex-center" id="notifications_nav">
<li class="dropdown flex-center" id="notifications_nav">
<a href="/dashboard/notifications" class="dropdown__trigger label" id="dropdown__trigger--notifications" role="button" aria-haspopup="true" aria-expanded="false">
<span><span data-feather="bell" aria-hidden="true"></span> Notifications <span class="js-notifications-count"></span></span>
</a>
Expand Down

0 comments on commit aa8ef6b

Please sign in to comment.