Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Revert "Merge pull request #22866 from mikehenrty/bug-1050023-v1.4"
Browse files Browse the repository at this point in the history
This reverts commit 2b42351.
  • Loading branch information
mikehenrty committed Aug 14, 2014
1 parent 2b42351 commit 3bf4da8
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions apps/system/js/notifications.js
Expand Up @@ -301,10 +301,9 @@ var NotificationScreen = {
detail.id.indexOf('app-notif-') === 0) {
notificationNode.dataset.obsoleteAPI = 'true';
}
var type = detail.type || 'desktop-notification';
notificationNode.dataset.type = type;
var manifestURL = detail.manifestURL || '';
notificationNode.dataset.manifestURL = manifestURL;
var type = notificationNode.dataset.type = detail.type ||
'desktop-notification';
notificationNode.dataset.manifestURL = detail.manifestURL || '';

if (detail.icon) {
var icon = document.createElement('img');
Expand Down Expand Up @@ -380,9 +379,8 @@ var NotificationScreen = {
if (typeof(ScreenManager) !== 'undefined' &&
!ScreenManager.screenEnabled) {
// bug 915236: disable turning on the screen for email notifications
// bug 1050023: disable turning on the screen for download notifications
if (type.indexOf('download-notification-downloading') === -1 &&
manifestURL.indexOf('email.gaiamobile.org') === -1) {
if (!detail.manifestURL ||
detail.manifestURL.indexOf('email.gaiamobile.org') === -1) {
ScreenManager.turnScreenOn();
}
}
Expand Down Expand Up @@ -470,13 +468,10 @@ var NotificationScreen = {

if (this.vibrates) {
if (document.hidden) {
// bug 1050023: disable vibration for downloads when asleep
if (type.indexOf('download-notification-downloading') === -1) {
window.addEventListener('visibilitychange', function waitOn() {
window.removeEventListener('visibilitychange', waitOn);
navigator.vibrate([200, 200, 200, 200]);
});
}
window.addEventListener('visibilitychange', function waitOn() {
window.removeEventListener('visibilitychange', waitOn);
navigator.vibrate([200, 200, 200, 200]);
});
} else {
navigator.vibrate([200, 200, 200, 200]);
}
Expand Down

0 comments on commit 3bf4da8

Please sign in to comment.