</dl>
</td>
[% END %]
- <td>
+ <td class="actions">
<div class="btn-group dropup">
<a class="btn btn-default btn-xs dropdown-toggle" id="z3950preview[% breeding_loo.breedingid | uri %]" role="button" data-toggle="dropdown" href="#">
Preview <b class="caret"></b>
[% Asset.js("js/acquisitions-menu.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
+ [% Asset.js("js/z3950_search.js") | $raw %]
<script>
$(document).ready(function(){
var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
"aaSorting": [[ 1, "asc" ]],
"bPaginate": false
}));
- /* Inline edit/delete links */
- $("td").click(function(event){
- var $tgt = $(event.target);
- var row = $(this).parent();
- $(".linktools").hide();
- $("tr").removeClass("selected");
- row.addClass("selected");
- if($tgt.is("a")||$tgt.is(":nth-child(6)")||$tgt.is(":nth-child(7)")){
- //Don't show inline links for cells containing links of their own.
- } else {
- var position = $(this).offset();
- var top = position.top+5;
- var left = position.left+5;
- $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
- }
- });
});
</script>
[% INCLUDE 'z3950_search.inc' %]
- [% Asset.js("js/z3950_search.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
[% MACRO jsinclude BLOCK %]
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
+ [% Asset.js("js/z3950_search.js") | $raw %]
<script>
$(document).ready(function(){
-
- $(".dropdown").on("hidden.bs.dropdown", function(){
- // Reset menu styles so that a click on the
- // original dropdown button toggle works correctly
- $(".dropdown").css("position","absolute");
- $(".dropdown-menu").css({
- "top" : "100%",
- "left" : "auto",
- "right" : 0
- });
- });
-
$("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": 't',
"aoColumnDefs": [
"aaSorting": [[ 1, "asc" ]],
"bPaginate": false
}));
-
- /* Display actions menu anywhere the table is clicked */
- $("td").click(function(event){
- var tgt = $(event.target);
- var row = $(this).parent();
- var rowid = row.attr("id");
- $("tr").removeClass("highlighted-row");
- row.addClass("highlighted-row");
- $(".dropdown").removeClass("open");
- if(tgt.is("a")||tgt.is(":nth-child(8)")){
- // Don't show inline links for cells containing links of their own.
- } else {
- event.stopPropagation();
- var dropdown = $(".dropdown", row);
- dropdown.addClass("open");
- var position = $(this).offset();
- var top = position.top + 5;
- var left = position.left + 5;
- dropdown.css("position","unset");
- $(".dropdown-menu", row).css({
- "top" : top,
- "left" : left,
- "right" : "unset"
- });
-
- }
- });
-
});
</script>
[% INCLUDE 'z3950_search.inc' %]
- [% Asset.js("js/z3950_search.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
</dl>
</td>
[% END %]
- <td>
+ <td class="actions">
<div class="btn-group dropup">
<a class="btn btn-default btn-xs dropdown-toggle" id="cataloguesearchactions[% breeding_loo.breedingid | html %]" role="button" data-toggle="dropdown" href="#">
Actions <b class="caret"></b>
[% INCLUDE 'columns_settings.inc' %]
<script>
$(document).ready(function(){
-
- $(".dropdown").on("hidden.bs.dropdown", function(){
- // Reset menu styles so that a click on the
- // original dropdown button toggle works correctly
- $(".dropdown").css("position","absolute");
- $(".dropdown-menu").css({
- "top" : "100%",
- "left" : "auto",
- "right" : 0
- });
- });
-
var columns_settings = [% ColumnsSettings.GetColumns( 'cataloguing', 'z3950_search', 'resultst', 'json' ) | $raw %];
var thetable = KohaTable("resultst", {
"aoColumnDefs": [
"aaSorting": [[ 1, "asc" ]],
"bPaginate": false
}, columns_settings );
-
-
- /* Display actions menu anywhere the table is clicked */
- $("td").click(function(event){
- var tgt = $(event.target);
- var row = $(this).parent();
- var rowid = row.attr("id");
- $("tr").removeClass("highlighted-row");
- row.addClass("highlighted-row");
- $(".dropdown").removeClass("open");
- if(tgt.is("a")||tgt.is(":nth-child(8)")){
- // Don't show inline links for cells containing links of their own.
- } else {
- event.stopPropagation();
- var dropdown = $(".dropdown", row);
- dropdown.addClass("open");
- var position = $(this).offset();
- var top = position.top + 5;
- var left = position.left + 5;
- dropdown.css("position","unset");
- $(".dropdown-menu", row).css({
- "top" : top,
- "left" : left,
- "right" : "unset"
- });
- }
- });
});
function columnsInit(){
$( ".checkboxed" ).unCheckCheckboxes();
return false;
});
- $( "#close_menu" ).on( "click", function(e) {
- e.preventDefault();
- $( ".linktools" ).hide();
- $( "tr" ).removeClass( "selected" );
- return false;
- });
+
$( ".submit" ).on( "click", function() {
$( "body" ).css( "cursor", "wait" );
});
return true;
}
});
- $( ".previewMARC" ).on( "click", function(e) {
+
+ /* Display actions menu anywhere the table is clicked */
+ /* Note: The templates where this is included must have a search results
+ table with the id "resultst" and "action" table cells with the class "actions" */
+ $("#resultst").on("click", "td", function(event){
+ var tgt = $(event.target);
+ var row = $(this).parent();
+ /* Remove highlight from all rows and add to the clicked row */
+ $("tr").removeClass("highlighted-row");
+ row.addClass("highlighted-row");
+ /* Remove any menus created on the fly for other rows */
+ $(".btn-wrapper").remove();
+
+ if( tgt.is("a") || tgt.hasClass("actions") ){
+ /* Don't show inline links for cells containing links of their own. */
+ } else {
+ event.stopPropagation();
+ /* Remove the "open" class from all dropup menus in case one is open */
+ $(".dropup").removeClass("open");
+ /* Create a clone of the Bootstrap dropup menu in the "Actions" column */
+ var menu_clone = $(".dropdown-menu", row)
+ .clone()
+ .addClass("menu-clone")
+ .css({
+ "display" : "block",
+ "position" : "absolute",
+ "top" : "auto",
+ "bottom" : "100%",
+ "right" : "auto",
+ "left" : "0",
+ });
+ /* Append the menu clone to the table cell which was clicked.
+ The menu must first be wrapped in a block-level div to clear
+ the table cell's text contents and then a relative-positioned
+ div to allow the menu to be positioned correctly */
+ tgt.append(
+ $('<div/>', {'class': 'btn-wrapper'}).append(
+ $('<div/>', {'class': 'btn-group'}).append(
+ menu_clone
+ )
+ )
+ );
+ }
+ });
+
+ $( "#resultst" ).on("click", ".previewMARC", function(e) {
e.preventDefault();
var ltitle = $( this ).text();
var page = $( this ).attr( "href" );
$( "#marcPreviewLabel" ).html( "" );
$( "#marcPreview .modal-body" ).html( "<div id='loading'><img src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' /> " + MSG_LOADING + "</div>" );
});
- $( ".previewData" ).on( "click", function(e) {
+ $( "#resultst" ).on("click", ".previewData", function(e) {
e.preventDefault();
var ltitle = $( this ).text();
var page = $( this ).attr( "href" );
$( "#dataPreviewLabel" ).html( "" );
$( "#dataPreview .modal-body" ).html( "<div id='loading'><img src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' /> " + MSG_LOADING + "</div>" );
});
- $( ".import_record" ).on( "click", function(e) {
+ $( "#resultst" ).on("click", ".import_record", function(e) {
e.preventDefault();
var data_breedingid = $( this ).data( "breedingid" );
var data_headingcode = $( this ).data( "heading_code" );