diff --git a/lib/zin/wg/dropmenu/v1.php b/lib/zin/wg/dropmenu/v1.php index dec581d56c..9a0afd53ec 100644 --- a/lib/zin/wg/dropmenu/v1.php +++ b/lib/zin/wg/dropmenu/v1.php @@ -58,7 +58,7 @@ class dropmenu extends wg if(empty($extra)) $extra = ''; if(empty($objectID)) $objectID = data($module . 'ID'); - if(empty($url)) + if(empty($url) && empty($data)) { $url = createLink($tab, 'ajaxGetDropMenu', "objectID=$objectID&module=$module&method=$method&extra=$extra"); } @@ -72,7 +72,6 @@ class dropmenu extends wg return zui::dropmenu ( set('_id', $id), - set('_id', $id ? $id : 'dropmenu'), set('data', $data), set('data-fetcher', $url), set(array('fetcher' => $url, 'text' => $text, 'defaultValue' => $objectID, 'cache' => $cache)), diff --git a/module/repo/css/browse.ui.css b/module/repo/css/browse.ui.css index babb73449a..2977a456d3 100644 --- a/module/repo/css/browse.ui.css +++ b/module/repo/css/browse.ui.css @@ -2,4 +2,5 @@ .repo-select{margin-left: 1rem; margin-right: 10px;} .repo-comment{width: 100%; display: block; word-break: keep-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} .dtable-cell-html{width: 100%;} -.container .sidebar{width: 550px;} \ No newline at end of file +.container .sidebar{width: 550px;} +#actionBar .dropdown-menu {margin-top: 10px; padding: 10px;} \ No newline at end of file diff --git a/module/repo/ui/browse.html.php b/module/repo/ui/browse.html.php index 01ce25bf0b..d363b4cc92 100644 --- a/module/repo/ui/browse.html.php +++ b/module/repo/ui/browse.html.php @@ -83,10 +83,106 @@ featureBar( /* zin: Define the toolbar on main menu. */ $refreshLink = $this->createLink('repo', 'browse', "repoID=$repoID&branchID=" . $base64BranchID . "&objectID=$objectID&path=" . $this->repo->encodePath($path) . "&revision=$revision&refresh=1"); $refreshItem = array('text' => $lang->refresh, 'url' => $refreshLink, 'class' => 'primary', 'icon' => 'refresh'); -$downloadItem = array('text' => $lang->repo->download, 'url' => '#modal-downloadCode', 'class' => 'primary download-btn', 'icon' => 'download', 'data-toggle' => 'modal', 'data-size' => '500px'); $tableData = initTableData($infos, $config->repo->repoDtable->fieldList, $this->repo); +$downloadWg = div +( + set::id('modal-downloadCode'), + set::title($lang->repo->downloadCode), + on('click', '', array('capture' => true, 'prevent' => true, 'stop' => true)), + $cloneUrl->svn ? div + ( + p(set::class('repo-downloadCode'), $lang->repo->cloneUrl), + formRow + ( + formGroup + ( + set::width('450px'), + input + ( + set::type('text'), + set::value($cloneUrl->svn), + set::readOnly(true), + ), + ), + formGroup + ( + set::width('50px'), + btn + ( + set::icon('copy'), + ) + ) + ), + ) : null, + + $cloneUrl->ssh ? div + ( + p(set::class('repo-downloadCode'), $lang->repo->sshClone), + formRow + ( + formGroup + ( + set::width('450px'), + input + ( + set::type('text'), + set::value($cloneUrl->ssh), + set::readOnly(true), + ), + ), + formGroup + ( + set::width('50px'), + btn + ( + set::class('copy-btn'), + set::icon('copy'), + ) + ) + ), + ) : null, + + $cloneUrl->http ? div + ( + p(set::class('repo-downloadCode'), $lang->repo->httpClone), + formRow + ( + formGroup + ( + set::width('450px'), + input + ( + set::type('text'), + set::value($cloneUrl->http), + set::readOnly(true), + ), + ), + formGroup + ( + set::width('50px'), + btn + ( + set::class('copy-btn'), + set::icon('copy'), + ) + ) + ), + ) : null, + + div + ( + setStyle(array('margin-top' => '20px')), + btn + ( + set::icon('down-circle'), + set::class('downloadZip-btn'), + set::text($lang->repo->downloadZip), + ) + ), +); + toolbar ( span( @@ -94,104 +190,19 @@ toolbar $lang->repo->notice->lastSyncTime . $cacheTime ), item(set($refreshItem)), - item(set($downloadItem)), -); - -modalTrigger -( - modal + dropdown ( - set::id('modal-downloadCode'), - set::title($lang->repo->downloadCode), - $cloneUrl->svn ? div + set::staticMenu(true), + set::subMenuTrigger('manual'), + btn ( - p(set::class('repo-downloadCode'), $lang->repo->cloneUrl), - formRow - ( - formGroup - ( - set::width('450px'), - input - ( - set::type('text'), - set::value($cloneUrl->svn), - set::readOnly(true), - ), - ), - formGroup - ( - set::width('50px'), - btn - ( - set::icon('copy'), - ) - ) - ), - ) : null, - - $cloneUrl->ssh ? div + setClass('primary download-btn'), + set::icon('download'), + $lang->repo->download + ), + to::items ( - p(set::class('repo-downloadCode'), $lang->repo->sshClone), - formRow - ( - formGroup - ( - set::width('450px'), - input - ( - set::type('text'), - set::value($cloneUrl->ssh), - set::readOnly(true), - ), - ), - formGroup - ( - set::width('50px'), - btn - ( - set::class('copy-btn'), - set::icon('copy'), - ) - ) - ), - ) : null, - - $cloneUrl->http ? div - ( - p(set::class('repo-downloadCode'), $lang->repo->httpClone), - formRow - ( - formGroup - ( - set::width('450px'), - input - ( - set::type('text'), - set::value($cloneUrl->http), - set::readOnly(true), - ), - ), - formGroup - ( - set::width('50px'), - btn - ( - set::class('copy-btn'), - set::icon('copy'), - ) - ) - ), - ) : null, - - to::footer - ( - set::footerClass('flex-center'), - btn - ( - set::icon('down-circle'), - set::class('downloadZip-btn'), - set::text($lang->repo->downloadZip), - ) + array($downloadWg) ), ) );