1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-12 01:50:52 +01:00

Only request facts if a repo is present

This commit is contained in:
Brendan Abbott 2016-12-19 14:08:40 +10:00
parent 66f8aae310
commit 6dd7789a2a
2 changed files with 2 additions and 0 deletions

View File

@ -739,6 +739,7 @@ var Application =
/* Retrieve the facts for the given repository type */
;(function () {
var el = document.querySelector("[data-md-source]");
if (!el) return Promise.resolve([]);
switch (el.dataset.mdSource) {
case "github":
return new _Material2.default.Source.Adapter.GitHub(el).fetch();

View File

@ -196,6 +196,7 @@ export default class Application {
/* Retrieve the facts for the given repository type */
;(() => {
const el = document.querySelector("[data-md-source]")
if (!el) return Promise.resolve([])
switch (el.dataset.mdSource) {
case "github": return new Material.Source.Adapter.GitHub(el).fetch()
default: return Promise.resolve([])