robnyman/Firefox-OS-Boilerplate-App — pull request #34 by Mte90 (2013-11-06 20:56:35+00:00)
Title: fix addNotification

If you try the boilerplate on Firefox, Chrome and the Simulator and click on addNotification nothing happens.

I have integrated the code on https://developer.mozilla.org/en-US/docs/Web/API/notification and tested.
Now on the browser cited above the notification work!

this is the new code that add for the new notification before a check of permission and after show the notification.
```
var addNotification = document.querySelector("#add-notification");
if (addNotification) {
addNotification.onclick = function () {
if ("Notification" in window) {
// Firefox OS 1.1 and higher

if (Notification.permission !== 'denied') {
Notification.requestPermission(function (permission) {
if(!('permission' in Notification)) {
Notification.permission = permission;
}
});
}

if (Notification.permission === "granted") {
var notification = new Notification("See this", {
body : "This is a notification"
});
}
}
else {
// Firefox OS 1.0
var notification = navigator.mozNotification.createNotification(
"See this",
"This is a notification"
);
notification.show();
}
};
}
```