Formalize document and window event listeners and allow plugins to override eventListeners.

This commit is contained in:
Bryce Curtis
2011-08-12 03:49:51 +08:00
parent 8c7db9aa32
commit a735a631f6
3 changed files with 132 additions and 11 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ var Connection = function() {
// set a timer if still offline at the end of timer send the offline event
me._timer = setTimeout(function(){
me.type = type;
PhoneGap.fireEvent('offline');
PhoneGap.fireDocumentEvent('offline');
me._timer = null;
}, me.timeout);
} else {
@@ -37,7 +37,7 @@ var Connection = function() {
me._timer = null;
}
me.type = type;
PhoneGap.fireEvent('online');
PhoneGap.fireDocumentEvent('online');
}
// should only fire this once