Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only call init() indirectly, and make those handlers which were calli…

…ng it call update() instead. It has the same effect since init() is called from update() anyway, and this prevents double-execution of update() if it happens to be called first (thanks to Paul Irish for pointing that out).
  • Loading branch information...
commit 40f2331174fdc7dccdc9365a04218f9d9149b9a9 1 parent 5290f3a
Jason Johnston authored
Showing with 3 additions and 5 deletions.
  1. +1 −3 sources/event_handlers.js
  2. +2 −2 sources/htc_open.txt
4 sources/event_handlers.js
View
@@ -177,12 +177,10 @@ function init() {
// Add property change listeners to ancestors if requested
initAncestorPropChangeListeners();
-
- update();
}
}
if( element.readyState === 'complete' ) {
- init();
+ update();
}
4 sources/htc_open.txt
View
@@ -11,8 +11,8 @@ Dual-licensed for use under the Apache License Version 2.0 or the General Public
<PUBLIC:ATTACH EVENT="onpropertychange" FOR="element" ONEVENT="propChanged()" />
<PUBLIC:ATTACH EVENT="onmouseenter" FOR="element" ONEVENT="mouseEntered()" />
<PUBLIC:ATTACH EVENT="onmouseleave" FOR="element" ONEVENT="mouseLeft()" />
- <PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="init()" />
- <PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="init()" />
+ <PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="update()" />
+ <PUBLIC:ATTACH EVENT="ondocumentready" FOR="element" ONEVENT="update()" />
<PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" />
<script type="text/javascript">
Please sign in to comment.
Something went wrong with that request. Please try again.