mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-05 13:55:54 +03:00
parent
f51226fd6e
commit
4f58c390d5
@ -1356,12 +1356,25 @@ module.exports = _.extend(reactify, {
|
||||
|
||||
|
||||
},{"../stores/TreeStore.coffee":22,"./LoadComponent.coffee":12}],15:[function(require,module,exports){
|
||||
var recl, rele;
|
||||
var appendNext, recl, rele, waitingScripts;
|
||||
|
||||
recl = React.createClass;
|
||||
|
||||
rele = React.createElement;
|
||||
|
||||
waitingScripts = null;
|
||||
|
||||
appendNext = function() {
|
||||
if (waitingScripts == null) {
|
||||
return;
|
||||
}
|
||||
if (waitingScripts.length === 0) {
|
||||
return waitingScripts = null;
|
||||
} else {
|
||||
return document.body.appendChild(waitingScripts.shift());
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = recl({
|
||||
displayName: "Script",
|
||||
componentDidMount: function() {
|
||||
@ -1369,8 +1382,14 @@ module.exports = recl({
|
||||
s = document.createElement('script');
|
||||
_.assign(s, this.props);
|
||||
urb.waspElem(s);
|
||||
document.body.appendChild(s);
|
||||
return this.js = s;
|
||||
s.onload = appendNext;
|
||||
this.js = s;
|
||||
if (waitingScripts != null) {
|
||||
return waitingScripts.push(s);
|
||||
} else {
|
||||
waitingScripts = [s];
|
||||
return appendNext();
|
||||
}
|
||||
},
|
||||
componentWillUnmount: function() {
|
||||
return document.body.removeChild(this.js);
|
||||
|
Loading…
Reference in New Issue
Block a user