Lines 78-114
$( document ).ready( function() {
Link Here
|
78 |
var link = $( "a[title='" + tgt.text() + "']", row ); |
78 |
var link = $( "a[title='" + tgt.text() + "']", row ); |
79 |
if( link.length == 1) link.click(); |
79 |
if( link.length == 1) link.click(); |
80 |
row.find('ul.dropdown-menu').hide(); |
80 |
row.find('ul.dropdown-menu').hide(); |
|
|
81 |
return; |
81 |
} else { |
82 |
} else { |
82 |
event.stopPropagation(); |
83 |
if( tgt.prop('nodeName') == 'TD' && !tgt.hasClass("actions") ){ |
83 |
/* Remove the "open" class from all dropup menus in case one is open */ |
84 |
/* Create a clone of the Bootstrap dropup menu in the "Actions" column */ |
84 |
$(".dropup").removeClass("open"); |
85 |
var menu_clone = $(".dropdown-menu", row) |
85 |
/* Create a clone of the Bootstrap dropup menu in the "Actions" column */ |
86 |
.clone() |
86 |
var menu_clone = $(".dropdown-menu", row) |
87 |
.addClass("show") |
87 |
.clone() |
88 |
.css({ |
88 |
.addClass("menu-clone") |
89 |
"display" : "block", |
89 |
.css({ |
90 |
"position" : "absolute", |
90 |
"display" : "block", |
91 |
"top" : "auto", |
91 |
"position" : "absolute", |
92 |
"bottom" : "100%", |
92 |
"top" : "auto", |
93 |
"right" : "auto", |
93 |
"bottom" : "100%", |
94 |
"left" : "0", |
94 |
"right" : "auto", |
95 |
}); |
95 |
"left" : "0", |
96 |
|
96 |
}); |
97 |
tgt.append( |
97 |
/* Append the menu clone to the table cell which was clicked. |
98 |
$('<div/>', {'class': 'btn-wrapper'}).append( |
98 |
The menu must first be wrapped in a block-level div to clear |
99 |
$('<div/>', {'class': 'btn-group'}).append( |
99 |
the table cell's text contents and then a relative-positioned |
100 |
menu_clone |
100 |
div to allow the menu to be positioned correctly */ |
101 |
) |
101 |
if( tgt.prop('nodeName') != 'TD' ) { |
|
|
102 |
// handling click on caret to improve menu position |
103 |
tgt = tgt.closest('td'); |
104 |
} |
105 |
tgt.append( |
106 |
$('<div/>', {'class': 'btn-wrapper'}).append( |
107 |
$('<div/>', {'class': 'btn-group'}).append( |
108 |
menu_clone |
109 |
) |
102 |
) |
110 |
) |
103 |
); |
111 |
); |
104 |
} |
112 |
} |
105 |
} |
113 |
}); |
106 |
}); |
114 |
|
107 |
|
115 |
- |
|
|