How to handle notifyjs click event - javascript

I would like to handle click events on the notification box by notifyjs, to link user to another page.
I understand that I could use jquery selector to select notifyjs class but that would break other notifications that are not meant to do the redirect.
I've look through notifyjs webpage and there's no click event documented.
How can I do so?
Thanks.

Related

Can i stop event from button of component of external module to happen in Angular(5)?

I import a component from external module which have a button.
On button click it does a console.log('test'); So it display 'test' in my console.
It's an external module so i can't access the code of this component. However i know the id of the button element. id='idtest'.
I'd like to open a confirm modal when i click on this button and execute the console.log('test') only if i click on 'ok' button and if i don't confirm, event does not happen.
Every solution, pure js or angular are appreciated.
Ever tried getting the element by id, add onclick and eventlistener and call event.stopPropagation()
You can edit css display none of that button than add another button id=test2
Now, you can write dialog code for that button click event. If the dialog ends with yes, execute button click event
$("#yourhiddenbutton).click()
You can use query selector to get hold of the button and add a listener on the click event.
document.querySelector('#idtest').addEventListener('click', function(){})
I would suggest using #ViewChild and then to something like this...
template: "<app-component #component></app-component>"
#ViewChild('component') public component: any
this.component.event.stopPropagation();
Since I don't know how that external component looks like, I can't offer you a better solution.
EDIT: However, it many cases it can lead to some nasty console errors and I wouldn't encourage using this. There rarely is a reason to stop a component from emitting the event. If the component doesn't suit your needs, you should prefer to use something else instead.

SlickGrid RightClick Event

I am using SlickGrid in my web application, and try to decide a priori, if I will show the contextmenu or not, depending on the row data I clicked on with the right mouse button. Unfortunately, I see no chance to get a right-click event, only the usual onClick event, fired after left-click. Any ideas?
Maybe this example will help you to handle right-click event:
https://github.com/mleibman/SlickGrid/blob/gh-pages/examples/example7-events.html
The method name is onContextMenu.

Reload the page if i click on outside the multiple dropdown box using javascript

I have a small query, I have a multiple dropdown box in my form. after selecting multiple value, if I click on outside the multiple drop down box page should reload. How can I make it happen using javascript. I have used "onmouseout(reload.form)" option but it is not working. Please help me on this.
Thanks
Ranjith
In this scenario, you might need click event rather mouseout(which is not on click but when mouse loses the focus).
For more details about click outside the element refer the below link
Javascript Detect Click event outside of div
So once you capture the click out event, you can just trigger the page load using
window.location.reload(true) or window.location.reload(false)
true or false depends on you need to load from cache or server.
Hope it helps!!
Seems like you should really connect to the change() signal on the select box instead. By depending on the mouse event, you will prevent people form using your form with the keyboard only, for instance. onmouseout will also not work on mobile devices

Event when user shares a page (Facebook SDK)

Is there an event that fires when a user shares something on their wall?
I'm successfully capturing the subscribe event when they click "Like", but I want one when they share it in the drop down box that shows up when you click the Like button.
I can't find any documentation on this, so I'm wondering if this exists or not.
it looks like you need to listen for the comment.create (instead of the edge.create) event in the FB callback...
http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/
I haven't tried it, but I suspect it works.

jQuery get beforeunload event source id

I am trying to alert the user when they leave the shopping page with cart filled up. And also get feedback or the reason for their exit.
I need to get event source id because to know whether they exit my site or navigate by clicking a link in my page.
Any one help me on this...
It's not possible. You should be able to catch if the user clicked a link to leave the page by manually setting up a listener event on each of them, but the browser does not give you any information about what led to the unload event. If it was an event ouside the document ("Back" button etc.), you're out of luck.

Categories

Resources