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

Pass in bidResponses into requestBids #66

Merged
merged 2 commits into from
Oct 14, 2015
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/adapters/appnexus.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var bidfactory = require('../bidfactory.js');
/* AppNexus bidder factory function
* Use to create a AppNexusAdapter object
*/


var AppNexusAdapter = function AppNexusAdapter() {
var isCalled = false;
Expand Down
24 changes: 14 additions & 10 deletions src/bidmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ exports.executeCallback = function() {

//execute one time callback
if(externalOneTimeCallback){
processCallbacks(externalOneTimeCallback);
var params = [];
var responseObj = pbjs.getBidResponses();
params.push(responseObj);

processCallbacks(externalOneTimeCallback,params);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added bid response

externalOneTimeCallback = null;
}

Expand All @@ -269,16 +273,16 @@ function triggerAdUnitCallbacks(adUnitCode){
}

function processCallbacks(callbackQueue, params){
var i;
if(utils.isArray(callbackQueue)){
for(i = 0; i < callbackQueue.length; i++){
var func = callbackQueue[i];
callFunction(func, params);
}
var i;
if(utils.isArray(callbackQueue)){
for(i = 0; i < callbackQueue.length; i++){
var func = callbackQueue[i];
callFunction(func, params);
}
else{
callFunction(callbackQueue, params);
}
}
else{
callFunction(callbackQueue, params);
}
}

function callFunction(func, args){
Expand Down