Permalink
Browse files

Switching loadingBay from a hidden div to a Document Fragment.

  • Loading branch information...
1 parent 4e7c6b6 commit b65f3ca5b63f565d239665f262f8fbedecae636d @tmcw tmcw committed Apr 15, 2011
Showing with 5 additions and 15 deletions.
  1. +2 −7 modestmaps.js
  2. +1 −1 modestmaps.min.js
  3. +2 −7 src/requests.js
View
@@ -706,12 +706,7 @@ if (!com) {
MM.RequestManager = function(parent) {
- // add an invisible div so that image.onload will have a srcElement in IE6
- // TODO: can we do this with a DOM fragment?
- this.loadingBay = document.createElement('div');
- this.loadingBay.id = parent.id+'-loading-bay';
- this.loadingBay.style.display = 'none';
- parent.appendChild(this.loadingBay);
+ this.loadingBay = document.createDocumentFragment();
this.requestsById = {};
this.openRequestCount = 0;
@@ -769,7 +764,7 @@ if (!com) {
}
// then check the loadingBay...
- var openRequests = this.loadingBay.getElementsByTagName('img');
+ var openRequests = this.loadingBay.childNodes;
for (var i = openRequests.length-1; i >= 0; i--) {
var img = openRequests[i];
if (!(img.id in validKeys)) {
Oops, something went wrong.

0 comments on commit b65f3ca

Please sign in to comment.