Skip to content
Snippets Groups Projects
Commit bfb9d857 authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Reorganized combined search JS; fixed some problems with status displays.

parent 5c3b75fd
No related merge requests found
/*global VuFind, setupOpenUrlLinks, checkItemStatuses, checkSaveStatuses, setupSaveRecordLinks */
VuFind.combinedSearch = (function() {
var init = function(container, url) {
container.load(url, '', function(responseText) {
if (responseText.length == 0) {
container.hide();
} else {
setupOpenUrlLinks(container);
checkItemStatuses(container);
checkSaveStatuses(container);
setupSaveRecordLinks(container);
}
});
};
var my = {
init: init
};
return my;
})();
...@@ -14,15 +14,8 @@ ...@@ -14,15 +14,8 @@
$loadJs = <<<JS $loadJs = <<<JS
$(document).ready(function(){ $(document).ready(function(){
var url = VuFind.path + '/Combined/Result?id=$searchClassIdEncoded&lookfor=$lookforEncoded'; var url = VuFind.path + '/Combined/Result?id=$searchClassIdEncoded&lookfor=$lookforEncoded';
$('$targetIdHtmlEscaped').load(url, '', function(responseText) { var container = $('$targetIdHtmlEscaped');
if (responseText.length == 0) { VuFind.combinedSearch.init(container, url);
$('$targetIdHtmlEscaped').hide();
}
$('a.openUrlEmbed').click(function() {
embedOpenUrlLinks($(this));
return false;
});
});
}); });
JS; JS;
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
// Load Javascript dependencies into header: // Load Javascript dependencies into header:
$this->headScript()->appendFile("check_item_statuses.js"); $this->headScript()->appendFile("check_item_statuses.js");
$this->headScript()->appendFile("check_save_statuses.js"); $this->headScript()->appendFile("check_save_statuses.js");
$this->headScript()->appendFile("combined-search.js");
// Style // Style
$this->headLink()->appendStylesheet('combined-search.css'); $this->headLink()->appendStylesheet('combined-search.css');
?> ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment