* [task#133002,doing,0.5h] add feature of switch version.
This commit is contained in:
@@ -85,6 +85,7 @@ class pivot extends control
|
||||
$this->view->versionSpecs = $this->pivot->getPivotVersions($pivotID);
|
||||
$this->view->version = $version == 'newest' ? $this->pivot->getMaxVersion($pivotID) : $version;
|
||||
$this->view->pivot = $pivot;
|
||||
$this->view->groupID = $groupID;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
function switchVersion(e)
|
||||
{
|
||||
const groupID = $(e.target).attr('data-group');
|
||||
const pivotID = $(e.target).attr('data-pivot');
|
||||
const version = $(e.target).attr('data-version');
|
||||
loadModal($.createLink('pivot', 'versions', `groupID=${groupID}&pivotID=${pivotID}&version=${version}`));
|
||||
}
|
||||
@@ -16,8 +16,19 @@ foreach($versionSpecs as $versionSpec)
|
||||
{
|
||||
$versionsTableBody[] = h::tr
|
||||
(
|
||||
h::td('#' . $versionSpec->version),
|
||||
h::td($versionSpec->desc),
|
||||
h::td
|
||||
(
|
||||
h::a
|
||||
(
|
||||
'#' . $versionSpec->version,
|
||||
set::href("javascript:;"),
|
||||
on::click("switchVersion"),
|
||||
setData('pivot', $pivot->id),
|
||||
setData('version', $versionSpec->version),
|
||||
setData('group', $groupID)
|
||||
)
|
||||
),
|
||||
h::td($versionSpec->desc)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user