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 <kchai@redhat.com>
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();
}
});