Skip to content

Commit aa4b1d8

Browse files
committed
Merge pull request #36 from edofic/develop
add a setting to implement `onClick` per notification
2 parents f59c1c6 + f23e464 commit aa4b1d8

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

examples/jgrowl.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@
143143
$('#test1').jGrowl("This will be prepended before the last message.", {
144144
glue: 'before'
145145
});
146+
147+
$.jGrowl("This message is sticky and clickable", {
148+
sticky: true,
149+
click: function(msg) {
150+
alert("You clicked me");
151+
}
152+
});
146153
});
147154
})(jQuery);
148155

jquery.jgrowl.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@
204204
open: function() {},
205205
beforeClose: function() {},
206206
close: function() {},
207+
click: function() {},
207208
animateOpen: {
208209
opacity: 'show'
209210
},
@@ -250,6 +251,7 @@
250251
.append($('<div/>').addClass('jGrowl-message').html(message))
251252
.data("jGrowl", o).addClass(o.theme).children('.jGrowl-close').bind("click.jGrowl", function() {
252253
$(this).parent().trigger('jGrowl.beforeClose');
254+
return false;
253255
})
254256
.parent();
255257

@@ -284,6 +286,8 @@
284286
}
285287
}).bind('jGrowl.afterOpen', function() {
286288
o.afterOpen.apply( notification , [notification,message,o,self.element] );
289+
}).bind('click', function() {
290+
o.click.apply( notification, [notification.message,o,self.element] );
287291
}).bind('jGrowl.beforeClose', function() {
288292
if ( o.beforeClose.apply( notification , [notification,message,o,self.element] ) !== false )
289293
$(this).trigger('jGrowl.close');

jquery.jgrowl.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)