Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.

Commit 69c9657

Browse files
committed
make moduleDom refreshable
1 parent 83835ee commit 69c9657

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

js.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
$js - asynchronous module definition framework
33
or just simple lightweight javascript dependencies manager
44
5-
@version 3.2
5+
@version 3.3
66
@link http://github.com/redcatphp/js/
77
@author Jo Surikat <jo@surikat.pro>
88
@website http://redcatphp.com
@@ -508,6 +508,7 @@
508508
}
509509
}
510510
}
511+
el.$js = o;
511512
var loadModuleDomElement = function(){
512513
var
513514
func = $js.module(module),
@@ -774,16 +775,20 @@
774775
return $js.invokeArray(mod,args);
775776
};
776777
js.paramsReflection = paramsReflection;
778+
js.moduleDomNs = 'js';
779+
js.moduleDomPath = 'js.module.dom/';
777780
js.moduleDom = function(prefixPath,attrNs){
778781
if(!prefixPath)
779-
prefixPath = 'js.module.dom/';
782+
prefixPath = $js.moduleDomPath;
780783
if(!attrNs)
781-
attrNs = 'js';
784+
attrNs = $js.moduleDomNs;
782785
var all = document.getElementsByTagName('*');
783786
for(var i=0;i<all.length;i++){
784-
var js = all[i].getAttribute(attrNs);
785-
if(js){
786-
moduleDomElement(prefixPath+js,all[i],attrNs);
787+
if(!all[i].$js){
788+
var js = all[i].getAttribute(attrNs);
789+
if(js){
790+
moduleDomElement(prefixPath+js,all[i],attrNs);
791+
}
787792
}
788793
}
789794
};

0 commit comments

Comments
 (0)