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

add a functionality for closing pnotify on mouse click #73

Closed
wants to merge 1 commit into from
Closed

add a functionality for closing pnotify on mouse click #73

wants to merge 1 commit into from

Conversation

maxwowpow
Copy link

Issue #41

Defaulted to false

close_click: false

Defaulted to false
```
close_click: false
```
@maxwowpow
Copy link
Author

@sciactive Will you merge this? It's not the best solution to diff the code after each update.
Regards.

@hperrin
Copy link
Member

hperrin commented Jan 22, 2014

I don't think this is the best solution. Rather than making another option, you could do something like this:

var notice = $.pnotify({
    text: "Click me to close.",
    closer: false,
    sticker: false
}).click(function(){ notice.pnotify_remove(); });

@hperrin hperrin closed this Feb 20, 2014
@maxwowpow
Copy link
Author

@hperrin And how that would support default behavior, concerning all new notifications?
if one defines a thousand "pnotify"s with different text. Should one also ALWAYS reduplicate your
".click(function(){ notice.pnotify_remove(); });" a thousand times? Or if one changes their mind and decides not to remove all generic notifications on click, should they search everywhere in the project to change all the lines? Or I don't understand something...

@hperrin
Copy link
Member

hperrin commented Mar 4, 2014

@maxgrass You can use something like the following:

$(function(){
    var temp = $.fn.pnotify;
    $.fn.pnotify = function(){
        var notice = temp.apply(this, arguments);
        notice.click(function(){ notice.pnotify_remove(); });
        return notice;
    };
});

I haven't run this, so I'm not sure if it will work, but it should.

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

Successfully merging this pull request may close these issues.

2 participants