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

[ Feature Request ] Pause on hover #110

Open
AbrahemAlhofe opened this issue Jun 15, 2021 · 2 comments
Open

[ Feature Request ] Pause on hover #110

AbrahemAlhofe opened this issue Jun 15, 2021 · 2 comments

Comments

@AbrahemAlhofe
Copy link
Contributor

Purpose

This feature will lets the user to read the long notification's message

Behavior

If we have put the duration 4 seconds, and the user hovered the notification on the third second the Notyf will clear the timer, later when the user leaves the notification, Notyf will resume the timer from the last second it stopped at, this second would be the third second until the end of duration ( 4 seconds )

Implementation

  1. if duration not zero, create "Timer" class what will handle duration properties
  2. then make "NotyfView" trigger "mouseover" and "mouseleave" event
  3. on "mouseover" call Timer.pause() method
  4. on "mouseleave" call Timer.resume() method
  5. on "Timer" finished remove the notification
AbrahemAlhofe added a commit to AbrahemAlhofe/notyf that referenced this issue Jun 15, 2021
…ver and resume on mouseleave

    - add "should pause on mouseover" test
    - add "EventListener", "Timer" utilities' classes
    - public "NotyfNotification.triggerEvent"
        | to make "NotyfView" trigger "mouseover" event on "NotyfNotification"
    - add "NotyfEvent.MouseOver"
    - add "NotyfEvent.MouseLeave"
    - update "Notyf._pushNotification"
        = pause "NotyfNotification" timer and resume timer on "mouseleave"
        = remove "NotyfNotification" on timer "finished" event
    - trigger "mouseover" event on "NotyfNotification" by "NotyfView"
    - trigger "mouseleave" event on "NotyfNotification" by "NotyfView"

close caroso1222#110
@stanciupaul
Copy link

Any news on this?

@naveen168
Copy link

Any update on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants