Bug 803327 - Provide window to viewportChanged in presenters. r=davidb

This commit is contained in:
Eitan Isaacson 2012-10-19 10:06:08 -07:00
parent 53bb206f98
commit d749b432ac

View File

@ -77,9 +77,17 @@ var EventManager = {
case 'scroll':
case 'resize':
{
// the target could be an element, document or window
let window = null;
if (aEvent.target instanceof Ci.nsIDOMWindow)
window = aEvent.target;
else if (aEvent.target instanceof Ci.nsIDOMDocument)
window = aEvent.target.defaultView;
else if (aEvent.target instanceof Ci.nsIDOMElement)
window = aEvent.target.ownerDocument.defaultView;
this.present(
function(p) {
return p.viewportChanged();;
return p.viewportChanged(window);
}
);
break;