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

Don't want to close message on double-click. #118

Open
rajansiingh opened this issue Jul 27, 2016 · 2 comments
Open

Don't want to close message on double-click. #118

rajansiingh opened this issue Jul 27, 2016 · 2 comments

Comments

@rajansiingh
Copy link

I have hidden the default close button in growl message but still when I double click on message it closes/hide. I want the message to display permanently not fade out/hide/close on double click.
My growl message contains some links inside it, so I can't do "pointer-events:none" on open event .

Please suggest. How to do it?

@blitzmann
Copy link

Hi there,

We had need of this functionality as well, so I looked into it a bit. Take a look here:

if (!message.clickToClose) {

It seems that there is a check here introduced with a910139 that checks to see if there is a flag that disables click to close. However, this is the only instance of this property that I can see. It is not set anywhere that I can see.

I was able to get around this by tweaking a few things. I don't have a diff available to me right now (and I may make a pull request for this later), but I changed that line to look like:

if (!message.disableClickToClose) {

Then I added a default value to this line:

}, _messagesKey = 'messages', _messageTextKey = 'text', _messageTitleKey = 'title', _messageSeverityKey = 'severity', _onlyUniqueMessages = true, _messageVariableKey = 'variables', _referenceId = 0, _inline = false, _position = 'top-right', _disableCloseButton = false, _disableIcons = false, _reverseOrder = false, _disableCountDown = false;

..., _disableCloseButton = false, ...

Finally I added the following to the message object on

disableClickToClose: _config.disableClickToClose === undefined ? _disableClickToClose : _config.disableClickToClose,

I was then able to call a growl with the following:

growl.error('This is an error.', { ttl: -1, disableCloseButton: true, disableClickToClose: true })

Again, I might make a pull request that introduces something like this. I'm thinking changing it to a permanent flag, which would disable TTL, the close button, and click to close.

@blitzmann
Copy link

I've added a pull request to address 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

2 participants