From 0595712550d1f88f75c0716c59698f6c8a686268 Mon Sep 17 00:00:00 2001 From: Timothee Groleau Date: Wed, 27 Apr 2016 09:10:39 +0800 Subject: [PATCH 1/2] Fix inconsistent click handler args + update docs --- README.md | 1 + jquery.jgrowl.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8448b22..1d7c654 100644 --- a/README.md +++ b/README.md @@ -70,5 +70,6 @@ $.jGrowl("A message with a beforeOpen callback and a different opening animation | open | function(e,m,o) {} | Callback to be used when a new notification is opened. This callback receives the notification's DOM context, the notifications message and its option object. | | beforeClose | function(e,m,o) {} | Callback to be used before a new notification is closed. This callback receives the notification's DOM context, the notifications message and its option object. | | close | function(e,m,o) {} | Callback to be used when a new notification is closed. This callback receives the notification's DOM context, the notifications message and its option object. | +| click | function(e,m,o) {} | Callback to be used when a notification is clicked. This callback receives the notification's DOM context, the notifications message and its option object. | | animateOpen | { opacity: 'show' } | The animation properties to use when opening a new notification (default to fadeOut). | | animateClose | { opacity: 'hide' } | The animation properties to use when closing a new notification (defaults to fadeIn). | diff --git a/jquery.jgrowl.js b/jquery.jgrowl.js index 14f8793..adb9dc0 100755 --- a/jquery.jgrowl.js +++ b/jquery.jgrowl.js @@ -299,7 +299,7 @@ }).bind('jGrowl.afterOpen', function() { o.afterOpen.apply( notification , [notification,message,o,self.element] ); }).bind('click', function() { - o.click.apply( notification, [notification.message,o,self.element] ); + o.click.apply( notification, [notification,message,o,self.element] ); }).bind('jGrowl.beforeClose', function() { if ( o.beforeClose.apply( notification , [notification,message,o,self.element] ) !== false ) $(this).trigger('jGrowl.close'); From fc8fcbe3646a99cd79cbfce284d248f71f2f977c Mon Sep 17 00:00:00 2001 From: Timothee Groleau Date: Wed, 27 Apr 2016 09:26:02 +0800 Subject: [PATCH 2/2] Minor grammar fixes in callbacks' documentation --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1d7c654..7dfd856 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,12 @@ $.jGrowl("A message with a beforeOpen callback and a different opening animation | closer | true | Whether or not the close-all button should be used when more then one notification appears on the screen. Optionally this property can be set to a function which will be used as a callback when the close all button is clicked. This must be changed in the defaults before the startup method is called. | | closeTemplate | × | This content is used for the individual notification close links that are added to the corner of a notification. This must be changed in the defaults before the startup method is called. | | closerTemplate | <div>[ close all ]</div> | This content is used for the close-all link that is added to the bottom of a jGrowl container when it contains more than one notification. This must be changed in the defaults before the startup method is called. | -| log | function(e,m,o) {} | Callback to be used before anything is done with the notification. This is intended to be used if the user would like to have some type of logging mechanism for all notifications passed to jGrowl. This callback receives the notification's DOM context, the notifications message and its option object. | -| beforeOpen | function(e,m,o) {} | Callback to be used before a new notification is opened. This callback receives the notification's DOM context, the notifications message and its option object. | -| afterOpen | function(e,m,o) {} | Callback to be used after a new notification is opened. This callback receives the notification's DOM context, the notifications message and its option object. | +| log | function(e,m,o) {} | Callback to be used before anything is done with the notification. This is intended to be used if the user would like to have some type of logging mechanism for all notifications passed to jGrowl. This callback receives the notification's DOM context, the notification's message and its option object. | +| beforeOpen | function(e,m,o) {} | Callback to be used before a new notification is opened. This callback receives the notification's DOM context, the notification's message and its option object. | +| afterOpen | function(e,m,o) {} | Callback to be used after a new notification is opened. This callback receives the notification's DOM context, the notification's message and its option object. | | open | function(e,m,o) {} | Callback to be used when a new notification is opened. This callback receives the notification's DOM context, the notifications message and its option object. | -| beforeClose | function(e,m,o) {} | Callback to be used before a new notification is closed. This callback receives the notification's DOM context, the notifications message and its option object. | -| close | function(e,m,o) {} | Callback to be used when a new notification is closed. This callback receives the notification's DOM context, the notifications message and its option object. | -| click | function(e,m,o) {} | Callback to be used when a notification is clicked. This callback receives the notification's DOM context, the notifications message and its option object. | +| beforeClose | function(e,m,o) {} | Callback to be used before a new notification is closed. This callback receives the notification's DOM context, the notification's message and its option object. | +| close | function(e,m,o) {} | Callback to be used when a new notification is closed. This callback receives the notification's DOM context, the notification's message and its option object. | +| click | function(e,m,o) {} | Callback to be used when a notification is clicked. This callback receives the notification's DOM context, the notification's message and its option object. | | animateOpen | { opacity: 'show' } | The animation properties to use when opening a new notification (default to fadeOut). | | animateClose | { opacity: 'hide' } | The animation properties to use when closing a new notification (defaults to fadeIn). |