* adjust for doc dropmenu.

This commit is contained in:
wangyidong
2021-04-15 09:34:36 +08:00
parent fa5646b0ee
commit 656b745a3e
6 changed files with 29 additions and 15 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ $lang->doc->noArticle = 'No articles.';
$lang->doc->noLib = 'No libraries. ';
$lang->doc->noBook = 'The WIKI library has not created a manual, please create a new one :)';
$lang->doc->cannotCreateOffice = 'Sorry, %s can only be created in ZenTao Enterprise. Contact us at renee@easysoft.ltd to try ZenTao Enterprise.';
$lang->doc->notSetOffice = "<p>To create a %s document, you need to configure <a href='%s' target='_parent'>office convert</a>.<p>";
$lang->doc->notSetOffice = "<p>To create a %s document, you need to configure <a href='%s'>office convert</a>.<p>";
$lang->doc->noSearchedDoc = 'No documents found.';
$lang->doc->noEditedDoc = 'You have not edited any documents.';
$lang->doc->noOpenedDoc = 'You have not created any documents.';
+1 -1
View File
@@ -182,7 +182,7 @@ $lang->doc->noArticle = '暂时没有文章。';
$lang->doc->noLib = '暂时没有文档库。';
$lang->doc->noBook = 'WIKI库还未创建手册,请新建 :)';
$lang->doc->cannotCreateOffice = '<p>对不起,企业版才能创建%s文档。<p><p>试用企业版,请联系我们:4006-8899-23 &nbsp; 0532-86893032。</p>';
$lang->doc->notSetOffice = "<p>创建%s文档,需要配置<a href='%s' target='_parent'>Office转换设置</a>。<p>";
$lang->doc->notSetOffice = "<p>创建%s文档,需要配置<a href='%s'>Office转换设置</a>。<p>";
$lang->doc->noSearchedDoc = '没有搜索到任何文档。';
$lang->doc->noEditedDoc = '您还没有编辑任何文档。';
$lang->doc->noOpenedDoc = '您还没有创建任何文档。';
+4 -2
View File
@@ -1922,7 +1922,8 @@ EOF;
$output .= "<div class='table-col'><div class='list-group'>";
foreach($objects as $key => $object)
{
$output .= html::a(inlink('objectLibs', "type=$type&objectID=$key"), $object, '', "data-app='{$this->app->openApp}'");
$selected = $key == $objectID ? 'selected' : '';
$output .= html::a(inlink('objectLibs', "type=$type&objectID=$key"), $object, '', "class='$selected' data-app='{$this->app->openApp}'");
}
$output .= "</div></div></div></div></div>";
}
@@ -1934,7 +1935,8 @@ EOF;
$output .= "<div class='table-col'><div class='list-group'>";
foreach($libs as $key => $lib)
{
$output .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$key"), $lib->name, '', "data-app='{$this->app->openApp}'");
$selected = $key == $libID ? 'selected' : '';
$output .= html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$key"), $lib->name, '', "class='$selected' data-app='{$this->app->openApp}'");
}
$output .= "</div></div></div></div></div>";
}
+1 -7
View File
@@ -20,13 +20,7 @@
</div>
<?php if(isset($this->config->bizVersion)):?>
<div class='alert alert-warning strong'>
<?php
$isonlybody = isonlybody();
unset($_GET['onlybody']);
printf($lang->doc->notSetOffice, zget($lang->doc->typeList, $docType), common::hasPriv('custom', 'libreoffice') ? $this->createLink('custom', 'libreoffice') : '###');
if($isonlybody) $_GET['onlybody'] = 'yes';
?>
<?php printf($lang->doc->notSetOffice, zget($lang->doc->typeList, $docType), common::hasPriv('custom', 'libreoffice') ? $this->createLink('custom', 'libreoffice') : '###');?>
</div>
<?php else:?>
<div class='alert alert-warning strong'><?php printf($lang->doc->cannotCreateOffice, zget($lang->doc->typeList, $docType));?></div>
+12
View File
@@ -38,4 +38,16 @@
<?php endif;?>
</div>
<?php js::set('type', 'doc');?>
<script>
$('#pageNav .btn-group.angle-btn').click(function()
{
if($(this).hasClass('opened')) return;
$(this).addClass('opened');
setTimeout(function()
{
scrollToSelected();
}, 100);
})
</script>
<?php include '../../common/view/footer.html.php';?>
+10 -4
View File
@@ -835,16 +835,22 @@ function adjustMenuWidth()
/**
* Scroll to selected item in drop menu.
*
* @param string $id
* @access public
* @return void
*/
function scrollToSelected()
function scrollToSelected(id)
{
$('#dropMenu .table-row .list-group').mouseout(function(){$(this).find('.active').removeClass('active')});
if($('#dropMenu .table-row .col-left .list-group .selected').length > 0)
if(typeof(id) == 'undefined') id = '#dropMenu .table-col .list-group'
$id = $(id);
$selected = $id.find('.selected');
$id.mouseout(function(){$(this).find('.active').removeClass('active')});
if($selected.length > 0)
{
var offsetHeight = 75;
$('#dropMenu .table-row .col-left .list-group').scrollTop($('#dropMenu .table-row .col-left .list-group .selected').position().top - offsetHeight);
$id.scrollTop($selected.position().top - offsetHeight);
}
}