* [bug#56300] adjust repo diff paage event.
This commit is contained in:
@@ -53,7 +53,7 @@ $(function()
|
||||
|
||||
window.downloadCode = function()
|
||||
{
|
||||
var url = $(this).data('link');
|
||||
var url = $(event.target).closest('.repoDownload-code').data('link');
|
||||
var activeFilePath = $('#monacoTabs .nav-item .active').attr('href').substring(5).replace(/-/g, '=');
|
||||
window.open(url.replace('{path}', activeFilePath), '_self');
|
||||
return;
|
||||
|
||||
@@ -33,7 +33,7 @@ jsVar('urlParams', "repoID=$repoID&objectID=$objectID&entry=%s&oldRevision=$oldR
|
||||
$dropMenus = array();
|
||||
if(!$inModal)
|
||||
{
|
||||
if(common::hasPriv('repo', 'download')) $dropMenus[] = array('text' => $this->lang->repo->downloadDiff, 'icon' => 'download', 'data-link' => $this->repo->createLink('download', "repoID=$repoID&path={path}&fromRevision=$oldRevision&toRevision=$newRevision&type=path"), 'id' => 'repoDownloadCode');
|
||||
if(common::hasPriv('repo', 'download')) $dropMenus[] = array('text' => $this->lang->repo->downloadDiff, 'icon' => 'download', 'data-link' => $this->repo->createLink('download', "repoID=$repoID&path={path}&fromRevision=$oldRevision&toRevision=$newRevision&type=path"), 'className' => 'repoDownload-code');
|
||||
|
||||
$dropMenus[] = array('text' => $this->lang->repo->viewDiffList['inline'], 'icon' => 'snap-house', 'id' => 'inline', 'class' => 'inline-appose');
|
||||
$dropMenus[] = array('text' => $this->lang->repo->viewDiffList['appose'], 'icon' => 'col-archive', 'id' => 'appose', 'class' => 'inline-appose');
|
||||
@@ -46,6 +46,8 @@ div(
|
||||
set::id('monacoTabs'),
|
||||
set::className('relative'),
|
||||
on::click('.monaco-close')->call('closeTab', jsRaw('this')),
|
||||
on::click('.repoDownload-code')->call('downloadCode'),
|
||||
on::click('.inline-appose')->call('inlineAppose'),
|
||||
div(setStyle(array('position' => 'absolute', 'width' => '100%', 'height' => '35px', 'background' => '#efefef', 'top' => '0px'))),
|
||||
tabPane
|
||||
(
|
||||
@@ -66,8 +68,6 @@ div(
|
||||
(
|
||||
set::arrow(false),
|
||||
set::staticMenu(true),
|
||||
on::click('#repoDownloadCode')->call('downloadCode'),
|
||||
on::click('.inline-appose')->call('inlineAppose'),
|
||||
btn
|
||||
(
|
||||
setClass('ghost text-black pull-right absolute top-0 right-0 z-10 monaco-dropmenu'),
|
||||
|
||||
Reference in New Issue
Block a user