Load iFrame on page load

This commit is contained in:
Berkeley Martinez
2015-11-22 19:42:53 -08:00
parent 6f98f62dd9
commit 5a785dbad7
7 changed files with 123 additions and 84 deletions

View File

@@ -3,7 +3,7 @@ window.common = (function(global) {
// all classes should be stored here
// called at the beginning of dom ready
const {
Rx: { config },
Rx: { Disposable, Observable, config },
common = { init: [] }
} = global;
@@ -86,5 +86,21 @@ window.common = (function(global) {
return code.replace(regexp, text);
};
common.getScriptContent$ = function getScriptContent$(script) {
return Observable.create(function(observer) {
const jqXHR = $.get(script)
.success(data => {
observer.onNext(data);
observer.onCompleted();
})
.fail(e => observer.onError(e))
.always(() => observer.onCompleted());
return new Disposable(() => {
jqXHR.abort();
});
});
};
return common;
})(window);