Skip to content

Commit 27132fb

Browse files
author
zhenshuai
committed
- upgrade to Notify.js 2.x
- Notify.js requestPermission function has not onPermissionDefaultCallback, so add fork and modify
1 parent 6d6dbb9 commit 27132fb

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

dist/angular-wt-genius-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-wt-genius.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,21 @@ angular.module('wt.genius', []);
5252
notSetPermission : Notify.permissionLevel == 'default',
5353
checkPermission : function (onSuccess, onError, onThen) {
5454
//验证权限,设置开启与禁止
55-
var onSuccess = onSuccess || function () {
56-
};
57-
var onError = onError || function () {
58-
};
59-
var onThen = onThen || function () {
60-
};
6155
if (Notify.needsPermission) {
6256
Notify.requestPermission(function () {
6357
result.permissionLevel = 'granted';
6458
result.needsPermission = false;
65-
onSuccess();
59+
onSuccess && onSuccess();
6660
}, function () {
6761
result.permissionLevel = 'denied';
6862
result.needsPermission = true;
69-
onError();
63+
onError && onError();
64+
}, function () {
65+
result.notSetPermission = true;
7066
});
7167
} else {
7268
result.permissionLevel = 'granted';
73-
onSuccess();
69+
onSuccess && onSuccess();
7470
}
7571
result.notSetPermission = false;
7672
onThen();
@@ -81,8 +77,7 @@ angular.module('wt.genius', []);
8177
permissionLevel : Notify.permissionLevel
8278
};
8379
return result;
84-
}
85-
];
80+
}];
8681
}]);
8782
})();
8883
/**

0 commit comments

Comments
 (0)