Remove package with modified dragger tags.

Put the new dragger tags into the template variables generated by the Layout.
Update the Layout Help now that dragger.icon is inside the position loops.
Remove the gotcha text for the manual modification solution.
This commit is contained in:
Colin Kuskie 2009-04-17 15:59:05 +00:00
parent ded86ab837
commit fa2768ea50
4 changed files with 14 additions and 19 deletions

View file

@ -175,6 +175,7 @@ sub prepareView {
}
my %vars;
$vars{showAdmin} = ($session->var->isAdminOn && $self->canEdit && $self->canEditIfLocked);
my $splitter = $self->{_viewSplitter} = $self->getSeparator;
@ -194,9 +195,12 @@ sub prepareView {
$child->prepareView;
$placeHolder{$assetId} = $child;
push @children, {
id => $assetId,
isUncommitted => $child->get('status') eq 'pending',
content => $splitter . $assetId . '~~',
id => $assetId,
isUncommitted => $child->get('status') eq 'pending',
content => $splitter . $assetId . '~~',
};
if ($vars{showAdmin}) {
$children[-1]->{'dragger.icon'} = sprintf '<div id="td%s_handle" class="dragable"><div class="dragTrigger dragTriggerWrap">%s</div></div>', $assetId, $session->icon->drag('class="dragTrigger"');
};
}
@ -230,7 +234,6 @@ sub prepareView {
unshift @{ $vars{"position1_loop"} }, reverse @children;
}
$vars{showAdmin} = ($session->var->isAdminOn && $self->canEdit && $self->canEditIfLocked);
if ($vars{showAdmin}) {
# under normal circumstances we don't put HTML stuff in our code, but this will make it much easier
# for end users to work with our templates
@ -247,7 +250,6 @@ sub prepareView {
}
</style>
');
$vars{"dragger.icon"} = '<div class="dragTrigger dragTriggerWrap">'.$session->icon->drag('class="dragTrigger"').'</div>';
$vars{"dragger.init"} = '
<iframe id="dragSubmitter" style="display: none;" src="'.$session->url->extras('spacer.gif').'"></iframe>
<script type="text/javascript">

View file

@ -18,11 +18,15 @@ our $HELP = {
},
],
variables => [
{ 'name' => 'showAdmin' },
{ 'name' => 'dragger.icon' },
{ 'name' => 'showAdmin' },
{ 'name' => 'dragger.init' },
{ 'name' => 'position1_loop',
'variables' => [ { 'name' => 'id' }, { 'name' => 'content' }, { 'name' => 'isUncommitted' }, ]
'variables' => [
{ 'name' => 'id' },
{ 'name' => 'content' },
{ 'name' => 'isUncommitted' },
{ 'name' => 'dragger.icon' },
]
},
],
fields => [],