projects
/
openx
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b6ffa68
)
Fetch on resize: initial fetch considers min/max-widths
author
Kai Moritz
<kai@juplo.de>
Thu, 28 Feb 2013 15:47:04 +0000
(16:47 +0100)
committer
Kai Moritz
<kai@juplo.de>
Thu, 28 Feb 2013 16:33:59 +0000
(17:33 +0100)
jquery.openx.js
patch
|
blob
|
history
diff --git
a/jquery.openx.js
b/jquery.openx.js
index
a2343bb
..
a9827af
100644
(file)
--- a/
jquery.openx.js
+++ b/
jquery.openx.js
@@
-31,6
+31,7
@@
slots = {},
min_width = {},
max_width = {},
slots = {},
min_width = {},
max_width = {},
+ width,
queue = [],
output = [];
queue = [],
output = [];
@@
-190,6
+191,9
@@
});
}
});
}
+ /** Set initial window-width */
+ width = $(document).width();
+
/** Fetch the JavaScript for Flash and schedule the initial fetch */
$.getScript(domain + settings.delivery + '/' + settings.fl, fetch_ads);
/** Fetch the JavaScript for Flash and schedule the initial fetch */
$.getScript(domain + settings.delivery + '/' + settings.fl, fetch_ads);
@@
-202,8
+206,10
@@
/** Order banners for all zones that were found on the page */
src += '?zones=';
for(id in slots) {
/** Order banners for all zones that were found on the page */
src += '?zones=';
for(id in slots) {
- queue.push(id);
- src += escape(id + '=' + OA_zones[slots[id].id] + "|");
+ if (width >= min_width[id] && width <= max_width[id]) {
+ queue.push(id);
+ src += escape(id + '=' + OA_zones[slots[id].id] + "|");
+ }
}
src += '&nz=1'; // << We want to fetch named zones!
}
src += '&nz=1'; // << We want to fetch named zones!