OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 while (leftIndex < leftKeys.length) { | 1433 while (leftIndex < leftKeys.length) { |
1434 var leftKey = leftKeys[leftIndex++]; | 1434 var leftKey = leftKeys[leftIndex++]; |
1435 removed.push(this.get(leftKey)); | 1435 removed.push(this.get(leftKey)); |
1436 } | 1436 } |
1437 while (rightIndex < rightKeys.length) { | 1437 while (rightIndex < rightKeys.length) { |
1438 var rightKey = rightKeys[rightIndex++]; | 1438 var rightKey = rightKeys[rightIndex++]; |
1439 added.push(other.get(rightKey)); | 1439 added.push(other.get(rightKey)); |
1440 } | 1440 } |
1441 return {added: added, removed: removed, equal: equal}; | 1441 return {added: added, removed: removed, equal: equal}; |
1442 }; | 1442 }; |
| 1443 |
| 1444 /** |
| 1445 * TODO: move into its own module |
| 1446 * @param {function()} callback |
| 1447 * @suppressGlobalPropertiesCheck |
| 1448 */ |
| 1449 function runOnWindowLoad(callback) { |
| 1450 /** |
| 1451 * @suppressGlobalPropertiesCheck |
| 1452 */ |
| 1453 function windowLoaded() { |
| 1454 self.removeEventListener('DOMContentLoaded', windowLoaded, false); |
| 1455 callback(); |
| 1456 } |
| 1457 |
| 1458 if (document.readyState === 'complete' || document.readyState === 'interactive
') |
| 1459 callback(); |
| 1460 else |
| 1461 self.addEventListener('DOMContentLoaded', windowLoaded, false); |
| 1462 } |
OLD | NEW |