diff --git a/module/pivot/control.php b/module/pivot/control.php index 5469c3e4a2..62178aa6f4 100644 --- a/module/pivot/control.php +++ b/module/pivot/control.php @@ -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(); } diff --git a/module/pivot/js/versions.ui.js b/module/pivot/js/versions.ui.js new file mode 100644 index 0000000000..ea8a3a89fc --- /dev/null +++ b/module/pivot/js/versions.ui.js @@ -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}`)); +} diff --git a/module/pivot/ui/versions.html.php b/module/pivot/ui/versions.html.php index 7eff4cda23..f4516e6983 100644 --- a/module/pivot/ui/versions.html.php +++ b/module/pivot/ui/versions.html.php @@ -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) ); }