From: Kefu Chai Date: Thu, 20 Feb 2020 05:05:45 +0000 (+0800) Subject: doc: do not try to patch #edit-on-github if not found X-Git-Tag: v15.1.1~352^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9d2f6329b76f39678a51a13a2f01a6546243f23d;p=ceph-ci.git doc: do not try to patch #edit-on-github if not found we add this element in _templates/page.html, which is only used for the content pages, not in the "search" page. to avoid the js errors, just disabled it if it's not found. Signed-off-by: Kefu Chai --- diff --git a/doc/_static/js/ceph.js b/doc/_static/js/ceph.js index e8114f0165d..5374029a0a3 100644 --- a/doc/_static/js/ceph.js +++ b/doc/_static/js/ceph.js @@ -33,8 +33,10 @@ $(function() { if (show_edit(branch, data)) { // patch the edit-on-github URL for correct branch var url = $("#edit-on-github").attr("href"); - url = url.replace("master", branch); - $("#edit-on-github").attr("href", url); + if (url) { + url = url.replace("master", branch); + $("#edit-on-github").attr("href", url); + } $("#docubetter").show(); } });