mirror of
https://github.com/unraid/webgui.git
synced 2026-03-11 21:38:50 -05:00
Improved context-sensitive help functionality
This commit is contained in:
@@ -330,8 +330,25 @@ $(function() {
|
||||
var top = ($.cookie('top')||0) - $('.tabs').offset().top - 75;
|
||||
if (top>0) {$('html,body').scrollTop(top);}
|
||||
$.removeCookie('top',{path:'/'});
|
||||
$('blockquote.inline_help').each(function(i){
|
||||
$(this).attr('id','helpinfo'+i).prev().children().first().css('cursor','help').click(function(){$('#helpinfo'+i).toggle('slow');});
|
||||
$('blockquote.inline_help').each(function(i) {
|
||||
$(this).attr('id','helpinfo'+i);
|
||||
var pin = $(this).prev();
|
||||
if (!pin.prop('nodeName')) pin = $(this).parent().prev();
|
||||
while (pin.prop('nodeName') && pin.prop('nodeName').search(/(table|dl)/i)==-1) pin = pin.prev();
|
||||
pin.find('tr:first,dt:last').each(function() {
|
||||
var node = $(this);
|
||||
var name = node.prop('nodeName').toLowerCase();
|
||||
if (name=='dt') {
|
||||
while (!node.html() || node.html().search(/(<input|<select|nbsp;)/i)>=0 || name!='dt') {
|
||||
if (name=='dt' && node.is(':first-of-type')) break;
|
||||
node = node.prev();
|
||||
name = node.prop('nodeName').toLowerCase();
|
||||
}
|
||||
node.css('cursor','help').click(function(){$('#helpinfo'+i).toggle('slow');});
|
||||
} else {
|
||||
if (node.html() && (name!='tr' || node.children('td:first').html())) node.css('cursor','help').click(function(){$('#helpinfo'+i).toggle('slow');});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user