Bug 34180: Template variable in JavaScript prevents authority MARC preview from displaying
Since template variables cannot be processed by JS, we must use a template to declare a JS variable which the JS file can used. This patch corrects this problem in the JS file which handles display of the authority MARC preview from the authority search results page. To test, apply the patch and go to Authorities. - Perform a search which will return multiple authority results. - Click "Actions -> MARC preview." The preview should display correctly. - Click "Actions -> MARC preview" on another search result. This preview should also look correct. - There should be no JavaScript errors in the browser console. Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
c7be846243
commit
6d433ffa89
2 changed files with 3 additions and 2 deletions
|
@ -88,8 +88,8 @@ $(document).ready(function () {
|
||||||
$("#header_search a[href='#entire_record']").tab("show");
|
$("#header_search a[href='#entire_record']").tab("show");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
const template_path = "[% interface | html %]/[% theme | html %]";
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<!-- / authorities_js.inc -->
|
<!-- / authorities_js.inc -->
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* global template_path */
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$(".authority_preview a").on("click", function(e){
|
$(".authority_preview a").on("click", function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -17,6 +18,6 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
$("#authorityDetail").on("hidden.bs.modal", function(){
|
$("#authorityDetail").on("hidden.bs.modal", function(){
|
||||||
$("#authorityDetail .modal-body, #authorityDetail .modal-title").html("");
|
$("#authorityDetail .modal-body, #authorityDetail .modal-title").html("");
|
||||||
$("#authorityDetail .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /></div>");
|
$("#authorityDetail .modal-body").html("<img src=\"" + template_path + "/img/spinner-small.gif\" alt=\"\" />");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue