mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-07 07:30:23 +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){
|
},{"../stores/TreeStore.coffee":22,"./LoadComponent.coffee":12}],15:[function(require,module,exports){
|
||||||
var recl, rele;
|
var appendNext, recl, rele, waitingScripts;
|
||||||
|
|
||||||
recl = React.createClass;
|
recl = React.createClass;
|
||||||
|
|
||||||
rele = React.createElement;
|
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({
|
module.exports = recl({
|
||||||
displayName: "Script",
|
displayName: "Script",
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
@ -1369,8 +1382,14 @@ module.exports = recl({
|
|||||||
s = document.createElement('script');
|
s = document.createElement('script');
|
||||||
_.assign(s, this.props);
|
_.assign(s, this.props);
|
||||||
urb.waspElem(s);
|
urb.waspElem(s);
|
||||||
document.body.appendChild(s);
|
s.onload = appendNext;
|
||||||
return this.js = s;
|
this.js = s;
|
||||||
|
if (waitingScripts != null) {
|
||||||
|
return waitingScripts.push(s);
|
||||||
|
} else {
|
||||||
|
waitingScripts = [s];
|
||||||
|
return appendNext();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
return document.body.removeChild(this.js);
|
return document.body.removeChild(this.js);
|
||||||
|
Loading…
Reference in New Issue
Block a user