Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed fireEvent() in mraid.js. #942

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions PrebidMobile/PrebidMobileRendering/Assets/mraid.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,22 +622,26 @@ debugPBMMRAID(() => "Beginning to add mraid.js...");
return;
}

var orgHandlers = [];
for (var handler in handlers)
orgHandlers[handler] = handlers[handler];

/* see if the listener is present */
for (var handler = 0; handler < handlers.length; handler++) {
for (var handler = 0; handler < orgHandlers.length; handler++) {
if (event == 'ready') {
handlers[handler]();
orgHandlers[handler]();
} else if (event == 'error') {
handlers[handler](args[0], args[1]);
orgHandlers[handler](args[0], args[1]);
} else if (event == 'stateChange') {
handlers[handler](args);
orgHandlers[handler](args);
} else if (event == 'viewableChange') {
handlers[handler](args);
orgHandlers[handler](args);
} else if (event == 'sizeChange') {
handlers[handler](args[0], args[1]);
orgHandlers[handler](args[0], args[1]);
} else if (event == 'exposureChange') {
handlers[handler](mraid.lastExposure.exposedPercentage, mraid.lastExposure.visibleRectangle, mraid.lastExposure.occlusionRectangles);
orgHandlers[handler](mraid.lastExposure.exposedPercentage, mraid.lastExposure.visibleRectangle, mraid.lastExposure.occlusionRectangles);
} else if (event == 'audioVolumeChange') {
handlers[handler](args);
orgHandlers[handler](args);
}
}
};
Expand Down