Merge branch 'wg8-nav'. Fix rendering and JS issues with the nav asset.

This commit is contained in:
Colin Kuskie 2013-09-13 13:36:23 -07:00
commit e42ca6b870

View file

@ -43,28 +43,33 @@ property assetsToInclude => (
default => "descendants", default => "descendants",
label => ["Relatives To Include", 'Asset_Navigation'], label => ["Relatives To Include", 'Asset_Navigation'],
hoverHelp => ["Relatives To Include description", 'Asset_Navigation'], hoverHelp => ["Relatives To Include description", 'Asset_Navigation'],
noFormPost => 1,
); );
property startType => ( property startType => (
fieldType => 'selectBox', fieldType => 'selectBox',
default => "relativeToCurrentUrl", default => "relativeToCurrentUrl",
label => ["Start Point Type", 'Asset_Navigation'], label => ["Start Point Type", 'Asset_Navigation'],
hoverHelp => ["Start Point Type description", 'Asset_Navigation'], hoverHelp => ["Start Point Type description", 'Asset_Navigation'],
noFormPost => 1,
); );
property startPoint => ( property startPoint => (
fieldType => 'text', fieldType => 'text',
default => 0, default => 0,
label => ["Start Point", 'Asset_Navigation'], label => ["Start Point", 'Asset_Navigation'],
hoverHelp => ["Start Point description", 'Asset_Navigation'], hoverHelp => ["Start Point description", 'Asset_Navigation'],
noFormPost => 1,
); );
property ancestorEndPoint => ( property ancestorEndPoint => (
noFormPost => 1, noFormPost => 1,
fieldType => 'selectBox', fieldType => 'selectBox',
default => 55, default => 55,
noFormPost => 1,
); );
property descendantEndPoint => ( property descendantEndPoint => (
noFormPost => 1, noFormPost => 1,
fieldType => 'selectBox', fieldType => 'selectBox',
default => 55, default => 55,
noFormPost => 1,
); );
property showSystemPages => ( property showSystemPages => (
label => [30, 'Asset_Navigation'], label => [30, 'Asset_Navigation'],
@ -160,51 +165,51 @@ override getEditForm => sub {
$fb->getTab("properties")->addField( "ReadOnly" => $fb->getTab("properties")->addField( "ReadOnly" =>
label => $i18n->get("Relatives To Include"), label => $i18n->get("Relatives To Include"),
hoverHelp => $i18n->get("Relatives To Include description"), hoverHelp => $i18n->get("Relatives To Include description"),
value => WebGUI::Form::checkbox( value => WebGUI::Form::Checkbox->new(
$self->session, { $self->session, {
checked => $ancestorsChecked, checked => $ancestorsChecked,
name => "assetsToInclude", name => "assetsToInclude",
extras => 'onchange="toggleAncestorEndPoint()"', extras => 'onchange="toggleAncestorEndPoint()"',
value => "ancestors" value => "ancestors"
} }
) )->toHtml
. $i18n->get('Ancestors') . $i18n->get('Ancestors')
. '<br />' . '<br />'
. WebGUI::Form::checkbox( . WebGUI::Form::Checkbox->new(
$self->session, { $self->session, {
checked => $selfChecked, checked => $selfChecked,
name => "assetsToInclude", name => "assetsToInclude",
value => "self" value => "self"
} }
) )->toHtml
. $i18n->get('Self') . $i18n->get('Self')
. '<br />' . '<br />'
. WebGUI::Form::checkbox( . WebGUI::Form::Checkbox->new(
$self->session, { $self->session, {
checked => $siblingsChecked, checked => $siblingsChecked,
name => "assetsToInclude", name => "assetsToInclude",
value => "siblings" value => "siblings"
} }
) )->toHtml
. $i18n->get('Siblings') . $i18n->get('Siblings')
. '<br />' . '<br />'
. WebGUI::Form::checkbox( . WebGUI::Form::Checkbox->new(
$self->session, { $self->session, {
checked => $descendantsChecked, checked => $descendantsChecked,
name => "assetsToInclude", name => "assetsToInclude",
value => "descendants", value => "descendants",
extras => 'onchange="toggleDescendantEndPoint()"' extras => 'onchange="toggleDescendantEndPoint()"'
} }
) )->toHtml
. $i18n->get('Descendants') . $i18n->get('Descendants')
. '<br />' . '<br />'
. WebGUI::Form::checkbox( . WebGUI::Form::Checkbox->new(
$self->session, { $self->session, {
checked => $pedigreeChecked, checked => $pedigreeChecked,
name => "assetsToInclude", name => "assetsToInclude",
value => "pedigree" value => "pedigree"
} }
) )->toHtml
. $i18n->get('Pedigree') . $i18n->get('Pedigree')
. '<br />' . '<br />'
); );
@ -232,19 +237,19 @@ override getEditForm => sub {
var displayNavAncestorEndPoint = true; var displayNavAncestorEndPoint = true;
function toggleDescendantEndPoint () { function toggleDescendantEndPoint () {
if (displayNavDescendantEndPoint) { if (displayNavDescendantEndPoint) {
document.getElementById('navDescendantEnd').style.display='none'; document.getElementById('descendantEndPoint_formId_row').style.display='none';
displayNavDescendantEndPoint = false; displayNavDescendantEndPoint = false;
} else { } else {
document.getElementById('navDescendantEnd').style.display=''; document.getElementById('descendantEndPoint_formId_row').style.display='';
displayNavDescendantEndPoint = true; displayNavDescendantEndPoint = true;
} }
} }
function toggleAncestorEndPoint () { function toggleAncestorEndPoint () {
if (displayNavAncestorEndPoint) { if (displayNavAncestorEndPoint) {
document.getElementById('navAncestorEnd').style.display='none'; document.getElementById('ancestorEndPoint_formId_row').style.display='none';
displayNavAncestorEndPoint = false; displayNavAncestorEndPoint = false;
} else { } else {
document.getElementById('navAncestorEnd').style.display=''; document.getElementById('ancestorEndPoint_formId_row').style.display='';
displayNavAncestorEndPoint = true; displayNavAncestorEndPoint = true;
} }
} }
@ -281,15 +286,19 @@ override getEditForm => sub {
. ">.././ (-1)</option><option value=\"0\"" . ">.././ (-1)</option><option value=\"0\""
. ( ( $start == 0 || $start > 0 ) ? ' selected=\"1\"' : '' ) . ( ( $start == 0 || $start > 0 ) ? ' selected=\"1\"' : '' )
. ">./ (0)</option></select>'; . ">./ (0)</option></select>';
document.getElementById('navStartPoint').innerHTML=types[document.getElementById('navStartType').descendantEndPointOptions,[document.getElementById('navStartType').selectedIndex].value]; document.getElementById('navStartPoint').innerHTML=types[document.getElementById('navStartType').options[document.getElementById('navStartType').selectedIndex].value];
} }
" . $afterScript . " " . $afterScript . "
YAHOO.util.Event.onDOMReady( initWebGUINavigation );
function initWebGUINavigation() {
changeStartPoint(); changeStartPoint();
" . ( $descendantsChecked ? "" : "toggleDescendantEndPoint();" ) . " " . ( $descendantsChecked ? "" : "toggleDescendantEndPoint();" ) . "
" . ( $ancestorsChecked ? "" : "toggleAncestorEndPoint();" ) . " " . ( $ancestorsChecked ? "" : "toggleAncestorEndPoint();" ) . "
}
//]]> //]]>
</script>" </script>"
); );
#document.getElementById('navStartPoint_formId').innerHTML=types[document.getElementById('navStartType').options[document.getElementById('navStartType').selectedIndex].value];
return $fb; return $fb;
}; };