Skip to content

Commit

Permalink
Use jquery event handling instead of addEventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
kayahr committed Dec 23, 2012
1 parent ccb363d commit 5c68237
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jquery.fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ function toggleFullScreen()
*/
function fullScreenChangeHandler(event)
{
window.console.log("changed");
jQuery(document).trigger(new jQuery.Event("fullscreenchange"));
}

Expand All @@ -127,6 +128,7 @@ function fullScreenChangeHandler(event)
*/
function fullScreenErrorHandler(event)
{
window.console.log("error");
jQuery(document).trigger(new jQuery.Event("fullscreenerror"));
}

Expand Down Expand Up @@ -156,8 +158,8 @@ function installFullScreenHandlers()
}

// Install the event handlers
document.addEventListener(change, fullScreenChangeHandler, true);
document.addEventListener(error, fullScreenErrorHandler, true);
jQuery(document).bind(change, fullScreenChangeHandler);
jQuery(document).bind(error, fullScreenErrorHandler);
}

jQuery.fn["fullScreen"] = fullScreen;
Expand Down

0 comments on commit 5c68237

Please sign in to comment.