forked from mystiq/hydrogen-web
Don't assume container node exists when loading bundle
Only look for the container node when needed
This commit is contained in:
parent
46bfab3eb7
commit
919542f8fc
1 changed files with 5 additions and 2 deletions
|
@ -14,10 +14,13 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const container = document.querySelector(".hydrogen");
|
let container;
|
||||||
|
|
||||||
export function spinner(t, extraClasses = undefined) {
|
export function spinner(t, extraClasses = undefined) {
|
||||||
if (container.classList.contains("legacy")) {
|
if (container === undefined) {
|
||||||
|
container = document.querySelector(".hydrogen");
|
||||||
|
}
|
||||||
|
if (container?.classList.contains("legacy")) {
|
||||||
return t.div({className: "spinner"}, [
|
return t.div({className: "spinner"}, [
|
||||||
t.div(),
|
t.div(),
|
||||||
t.div(),
|
t.div(),
|
||||||
|
|
Loading…
Reference in a new issue