Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

making it possible to set additional gritter options

  • Loading branch information...
commit e7c88c2e0b1b40738edd10e7943ba31db1548c39 1 parent 65c6d06
Phil Leggetter leggetter authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/PusherNotifier.js
11 src/PusherNotifier.js
View
@@ -5,7 +5,8 @@ function PusherNotifier(channel, options) {
eventName: 'notifications',
title: 'Notification',
image: 'images/notify.png',
- eventTextProperty: 'message'
+ eventTextProperty: 'message',
+ gritterOptions: {}
};
$.extend(this.settings, options);
@@ -14,9 +15,13 @@ function PusherNotifier(channel, options) {
channel.bind(this.settings.eventName, function(data){ self._handleNotification(data); });
};
PusherNotifier.prototype._handleNotification = function(data) {
- $.gritter.add({
+ var gritterOptions = {
title: this.settings.title,
text: data[this.settings.eventTextProperty].replace(/\\/g, ''),
image: this.settings.image
- });
+ };
+
+ $.extend(gritterOptions, this.settings.gritterOptions);
+
+ $.gritter.add(gritterOptions);
};
Please sign in to comment.
Something went wrong with that request. Please try again.