Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Adding Specs repository

  • Loading branch information...
commit e11c49844a4dd9dd3da4f06e088e6e9021be1d2c 1 parent 38fb508
@cpojer cpojer authored
Showing with 41 additions and 0 deletions.
  1. +3 −0  .gitmodules
  2. +37 −0 Source/Utilities/DOMReady.js
  3. +1 −0  Specs
View
3  .gitmodules
@@ -0,0 +1,3 @@
+[submodule "Specs"]
+ path = Specs
+ url = git://github.com/mootools/mootools-core-specs.git
View
37 Source/Utilities/DOMReady.js
@@ -0,0 +1,37 @@
+/*=
+name: DomReady
+description: The custom domready event. Fires as soon as the page loads (does not wait for images).
+requires: Element.Event
+=*/
+
+
+(function(){
+
+Event.defineModifier('domready', {add: function(fn){
+ if (Browser.loaded) fn.delay(1, this);
+}});
+
+var domready = function(){
+ if (Browser.loaded) return;
+ Browser.loaded = true;
+ [document, window].invoke('fireEvent', 'domready');
+};
+
+window.addEvent('load:flash', domready);
+
+if (Browser.ie){
+ var temp = document.newElement('div');
+ (function(){
+ (Function.attempt(function(){
+ return temp.inject(document.body).set('html', 'temp').eject();
+ })) ? domready() : arguments.callee.delay(50);
+ })();
+} else if (Browser.safari && Browser.version < 3.1){
+ (function(){
+ (['loaded', 'complete'].contains(document.readyState)) ? domready() : arguments.callee.delay(50);
+ })();
+} else {
+ document.addEvent('DOMContentLoaded:flash', domready);
+}
+
+})();
1  Specs
@@ -0,0 +1 @@
+Subproject commit c47fa5d10719d7a4bf55c6cb1b7d7fa194548fe2
Please sign in to comment.
Something went wrong with that request. Please try again.