1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-02 11:42:42 +01:00
phorge-phorge/webroot/rsrc/js/application/uiexample/notification-example.js
epriestley d119b051e8 Add a basic notification UI element
Summary: This is //extremely// basic but dead simple and should cover us for v1, I think. Let me know what features you need.

Test Plan: Used UI example page.

Reviewers: allenjohnashton, ddfisher, keebuhm

Reviewed By: ddfisher

CC: aran, ender

Maniphest Tasks: T944

Differential Revision: https://secure.phabricator.com/D2732
2012-06-13 15:00:24 -07:00

29 lines
642 B
JavaScript

/**
* @requires phabricator-notification
* javelin-stratcom
* javelin-behavior
* @provides javelin-behavior-phabricator-notification-example
*/
JX.behavior('phabricator-notification-example', function(config) {
JX.Stratcom.listen(
'click',
'notification-example',
function(e) {
e.kill();
var notification = new JX.Notification()
.setContent('It is ' + new Date().toString());
notification.listen(
'activate',
function(e) {
if (!confirm("Close notification?")) {
e.kill();
}
});
notification.show()
});
});