Improved hoverhelp system
This commit is contained in:
parent
978be4dc47
commit
1a20c3bf6b
3 changed files with 26 additions and 11 deletions
|
|
@ -259,8 +259,8 @@ sub displayFormWithWrapper {
|
|||
my ($fieldClass, $rowClass, $labelClass, $hoverHelp, $subtext) = $self->prepareWrapper;
|
||||
my $hoverCode = $self->getHoverCode($hoverHelp, $self->get('id') . '_wrapper');
|
||||
return '<tr'.$rowClass.'>
|
||||
<td'.$labelClass.' valign="top" style="width: 25%;">'.$self->get("label").'</td>
|
||||
<td valign="top"'.$fieldClass.' style="width: 75%;">'.$self->displayForm().$subtext.$hoverCode."</td>
|
||||
<td'.$labelClass.' valign="top" style="width: 25%;">'.$self->get("label") . $hoverCode . '</td>
|
||||
<td valign="top"'.$fieldClass.' style="width: 75%;">'.$self->displayForm().$subtext."</td>
|
||||
</tr>\n";
|
||||
} else {
|
||||
return $self->toHtmlAsHidden;
|
||||
|
|
@ -627,8 +627,8 @@ sub toHtmlWithWrapper {
|
|||
my ($fieldClass, $rowClass, $labelClass, $hoverHelp, $subtext) = $self->prepareWrapper;
|
||||
my $hoverCode = $self->getHoverCode($hoverHelp, $self->get('id') . '_description');
|
||||
return '<tr'.$rowClass.' id="'.$self->get("id").'_row">
|
||||
<td'.$labelClass.' id="' . $self->get('id') . '_description" valign="top" style="width: 180px;"><label for="'.$self->get("id").'">'.$self->get("label").'</label></td>
|
||||
<td valign="top"'.$fieldClass.'>'.$rawField . $subtext . $hoverCode . "</td>
|
||||
<td'.$labelClass.' id="' . $self->get('id') . '_description" valign="top" style="width: 180px;"><label for="'.$self->get("id").'">'.$self->get("label").'</label>' . $hoverCode . '</td>
|
||||
<td valign="top"'.$fieldClass.'>'.$rawField . $subtext . "</td>
|
||||
</tr>\n";
|
||||
} else {
|
||||
return $self->toHtmlAsHidden;
|
||||
|
|
@ -657,18 +657,17 @@ sub getHoverCode {
|
|||
my $url = $self->session->url;
|
||||
my $hoverHelp = shift;
|
||||
my $attachId = shift;
|
||||
$hoverHelp =~ s/\r/ /g;
|
||||
$hoverHelp =~ s/\n/ /g;
|
||||
$hoverHelp =~ s/'/\\'/g;
|
||||
$hoverHelp =~ s/^\s+//;
|
||||
return ''
|
||||
unless $hoverHelp;
|
||||
my $hover = '<script type="text/javascript">var tooltip = new YAHOO.widget.Tooltip("' . $attachId . '_tooltip", { context: "' . $attachId . '", text: \'' . $hoverHelp . '\', autodismissdelay: 100000, width: "300px"});</script>';
|
||||
my $hover = '<div class="wg-hoverhelp">' . $hoverHelp . '</div>';
|
||||
$style->setLink($url->extras('/yui/build/container/assets/container.css'),{ type=>'text/css', rel=>"stylesheet" });
|
||||
$style->setLink($url->extras('/hoverhelp.css'),{ type=>'text/css', rel=>"stylesheet" });
|
||||
$style->setScript($url->extras('/yui/build/yahoo/yahoo-min.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/yui/build/dom/dom-min.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/yui/build/event/event-min.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/yui/build/container/container-min.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/hoverhelp.js'),{ type=>'text/javascript' });
|
||||
return $hover;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue