Skip to content

Commit

Permalink
feat: add second argument event to trigger and fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Tan committed Jun 9, 2016
1 parent dd675de commit cd75c55
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions appcache-nanny.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@
on('obsolete', handleNetworkObsolete);

// fired when manifest download succeeded
on('noupdate', handleNetworkSucces);
on('cached', handleNetworkSucces);
on('progress', handleNetworkSucces);
on('downloading', handleNetworkSucces);
on('noupdate', handleNetworkSuccess);
on('cached', handleNetworkSuccess);
on('progress', handleNetworkSuccess);
on('downloading', handleNetworkSuccess);

// when browser goes online/offline, look for updates to make sure.
addEventListener('online', appCacheNanny.update, false);
Expand All @@ -299,9 +299,9 @@
// Trigger event on appCacheNanny. Once an update is ready, we
// keep looking for another update, but we stop triggering events.
//
function trigger(eventName) {
function trigger(eventName, event) {
if (hasUpdateFlag) return;
appCacheNanny.trigger(eventName);
appCacheNanny.trigger(eventName, event);
}

//
Expand Down Expand Up @@ -332,7 +332,7 @@
//
//
//
function handleNetworkSucces(event) {
function handleNetworkSuccesss(event) {
var prefix = '';

// when page gets opened for the very first time, it already has
Expand Down

0 comments on commit cd75c55

Please sign in to comment.