HubSpot / messenger

Growl-style alerts and messages for your app. #hubspot-open-source
http://github.hubspot.com/messenger/
MIT License
4.03k stars 408 forks source link

Limit the number of alerts open in same screen #101

Closed misner closed 8 years ago

misner commented 8 years ago

I have a basic huspot messenger alert (see below). Every time a user click, the little alert open.

The issue is if a user clicks like 10 times, the screen, particularly on a mobile device, get "too" full of alerts windows and you can't read the real webpage behind it anymore.

How can I limit the number of open / visible alerts to 3 for example?

Messenger().post({
message: 'my message', type: 'error', actions: { continueExternally: { label: "go here, action: function(){ location.href = 'localhost:3000';
} }, continueToExperience: { label: 'do more', action: function(){ location.href = 'http:/:example.com';
}

  }
}

});

thanks for any help

zackbloom commented 8 years ago

See the options here: http://github.hubspot.com/messenger/

Particularly the 'id' option if you only want one instance of a given message, and the 'maxMessages' option if you want to restrict the total number of messages visible at once.

On Nov 14, 2015, at 11:12 AM, misner notifications@github.com wrote:

I have a basic huspot messenger alert (see below). Every time a user click, the little alert open.

The issue is if a user clicks like 10 times, the screen, particularly on a mobile device, get "too" full of alerts windows and you can't read the real webpage behind it anymore.

How can I limit the number of open alert windows to 2 for example?

Messenger().post({

message: 'my message', type: 'error', actions: { continueExternally: { label: "go here, action: function(){ location.href = 'localhost:3000';

} }, continueToExperience: { label: 'do more', action: function(){ location.href = 'http:/:example.com';

}

} } });

thanks for any help

— Reply to this email directly or view it on GitHub.

misner commented 8 years ago

thanks, i actually had read it but managed not to spot it. thanks