* code for task#1648.

* add dropmenu to common/view jquery/dropmenu.
This commit is contained in:
azhi
2013-08-02 10:13:49 +08:00
parent 42827590d1
commit 79dfd7851b
14 changed files with 92 additions and 80 deletions
-1
View File
@@ -4,4 +4,3 @@
.confirm0 {color:gray; font-size:9px}
.confirm1 {color:green; font-size:9px}
tfoot .f-left {color:#141414;}
form {position:relative}
+1 -1
View File
@@ -57,8 +57,8 @@ js::set('customed', $customed);
}
?>
<div class='treeSlider'><span>&nbsp;</span></div>
<form method='post' action='<?php echo inLink('batchEdit', "productID=$productID");?>'>
<div class='treeSlider'><span>&nbsp;</span></div>
<table class='cont-lt1'>
<tr valign='top'>
<td class='side <?php echo $treeClass;?>' id='treebox'>
+8
View File
@@ -0,0 +1,8 @@
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
<?php
if($config->debug)
{
css::import($defaultTheme . 'dropmenu.css');
js::import($jsRoot . 'jquery/dropmenu/dropmenu.js');
}
?>
-125
View File
@@ -1,125 +0,0 @@
.listMenu
{
position:absolute;
background:#fff;
border: 1px solid rgba(0,0,0,0.2);
border-radius: 6px 6px 6px 6px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
.listMenu ul
{
margin:5px 0px;
}
.listMenu ul li
{
padding:3px 0px;
height:20px;
font-size:14px;
list-style-type:none;
}
.listMenu ul li:hover
{
background:#1AA8D2;
cursor:pointer;
}
.listMenu ul li a
{
padding:0px 20px;
float:left;
clear: both;
color: #333333;
display: block;
font-weight: normal;
line-height: 20px;
white-space: nowrap;
}
.listMenu ul li a[id$='Item']:after
{
border-color: transparent transparent transparent #CCCCCC;
border-style: solid;
border-width: 5px 0 5px 5px;
content: " ";
display: block;
float: right;
height: 0;
margin-right: -10px;
margin-top: 5px;
width: 0;
}
.groupButton
{
display:inline-block;
}
.groupButton > input[type='button'], .groupButton > button, #allchecker, #reversechecker
{
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #F5F5F5;
background-image: linear-gradient(to bottom, #FFFFFF, #E6E6E6);
background-repeat: repeat-x;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) #B3B3B3;
border-image: none;
border-radius: 0px;
border-style: solid;
border-width: 1px;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
cursor: pointer;
display: inline-block;
font-size: 14px;
line-height: 20px;
height: 30px;
margin-bottom: 0;
padding: 4px 8px;
text-align: center;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
}
.groupButton > input[type='button']:first-child, .groupButton #allchecker
{
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
}
.groupButton > input[type='button'] + input[type='button'], .groupButton > input[type='button'] + button, .groupButton #reversechecker
{
box-shadow: 1px 0 0 rgba(255, 255, 255, 0.125) inset, 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
margin-left:-1px;
margin-right:5px;
}
.groupButton > input[type='button'] + button
{
margin-left:-5px;
padding:10px 5px;
}
.groupButton button .caret
{
border-bottom: 4px solid #000000;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 0 none;
content: "";
display: inline-block;
height: 0;
width: 0;
vertical-align: top;
}
/* Disabled button and disabled link. */
.groupButton input[disabled='disabled'] {background:#eee; color:#ccc}
.listMenu li a.disabled {color:#ccc}
form {position:relative}
-62
View File
@@ -22,68 +22,6 @@ function changeAction(actionLink, hiddenwin)
$('form').attr('action', actionLink).submit();
}
/**
* Toggle sub menu.
*
* @param string $currentID
* @param string position = 'right' | 'top'
* @param bool entry
* @access public
* @return void
*/
function toggleSubMenu(currentID, position, menuIndex)
{
if(typeof(position) == 'undefined') position = 'right';
if(typeof(menuIndex) == 'undefined') menuIndex = 1;
if(menuIndex)
{
currentMenu = $('#' + currentID).parent().parent().parent().attr('id');
$('#' + currentID + 'Menu').bind('mouseover', function()
{
$('#' + currentMenu).show();
return $('#' + currentID + 'Menu').show()
});
$('#' + currentID).parent().bind('mouseleave', function()
{
return $('#' + currentID + 'Menu').hide()
});
$('#' + currentID + 'Menu').bind('mouseleave', function()
{
return $('#' + currentID + 'Menu').hide()
});
}
var offset = $('#' + currentID).offset();
var topOffset = 0;
var leftOffset = 0;
if(position == 'top')
{
topOffset = offset.top - $('#' + currentID + 'Menu').height() + 'px';
leftOffset = offset.left;
$('#' + currentID + 'Menu').css({top: topOffset, left: leftOffset});
}
if(position == 'right')
{
if(menuIndex == 1)
{
topOffset = offset.top - $('#' + currentID + 'Menu').height() + $('#' + currentID).parent().height() + "px";
leftOffset = offset.left + $('#' + currentID).parent().width();
$('#' + currentID + 'Menu').css({top: topOffset, left: leftOffset});
}
else if(menuIndex == 2)
{
currentMenu = $('#' + currentID).parent().parent().parent().attr('id');
rootID = currentMenu.replace('Menu', '');
topOffset = $('#' + rootID).offset().top - $('#' + currentID + 'Menu').height() + 20;
leftOffset = $('#' + rootID).offset().left + $('#' + rootID).parent().width() + $('#' + currentMenu).width();
$('#' + currentID + 'Menu').css({top: topOffset, left:leftOffset});
}
}
$('#' + currentID + 'Menu').toggle();
}
$(function()
{
if(browseType == 'bysearch') ajaxGetSearchForm();
+2 -1
View File
@@ -13,6 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/treeview.html.php';?>
<?php include '../../common/view/colorize.html.php';?>
<?php include '../../common/view/dropmenu.html.php';?>
<script language='Javascript'>
var browseType = '<?php echo $browseType;?>';
</script>
@@ -39,8 +40,8 @@ var browseType = '<?php echo $browseType;?>';
</div>
<div id='querybox' class='<?php if($browseType !='bysearch') echo 'hidden';?>'></div>
<div class='treeSlider'><span>&nbsp;</span></div>
<form method='post' id='productStoryForm'>
<div class='treeSlider'><span>&nbsp;</span></div>
<table class='cont-lt1'>
<tr valign='top'>
<td class='side <?php echo $treeClass;?>' id='treebox'>
+1 -1
View File
@@ -3,4 +3,4 @@
#sidebar{position:absolute;left:15px;top:185px;width:20px;height:20px;cursor:pointer;background:url(theme/default/images/main/zt-icons.png) -81px -161px;}
#hideButton{cursor:pointer;}
#hideButton span{padding:2px 10px; background:url(theme/default/images/main/zt-icons.png) -100px -161px;}
form { position:relative }
#featurebar .f-right .icon-green-task-import {padding:2px 8px; background:url(theme/default/images/main/zt-icons.png) 0px -82px;}
+1 -1
View File
@@ -21,8 +21,8 @@
var browseType = '<?php echo $browseType;?>';
</script>
<div id='querybox' class='<?php if($browseType != 'bysearch') echo 'hidden';?>'></div>
<form method='post' id='projectTaskForm'>
<div class='treeSlider'><span>&nbsp;</span></div>
<form method='post' id='projectTaskForm'>
<table class='cont-lt2'>
<tr valign='top'>
<td class='side'>
+17
View File
@@ -1,3 +1,4 @@
<?php include '../../common/view/dropmenu.html.php';?>
<div id='featurebar'>
<div class='f-left'>
<?php
@@ -22,9 +23,25 @@
if(!isset($orderBy)) $orderBy = '';
common::printIcon('task', 'report', "project=$projectID&browseType=$browseType");
if($browseType != 'needconfirm') common::printIcon('task', 'export', "projectID=$projectID&orderBy=$orderBy");
echo '<span class="link-button">';
echo html::a("#", "&nbsp;", '', "id='importAction' class='icon-green-task-import' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->import}'");
echo html::a("#", $lang->import, '', "id='importAction' onclick=toggleSubMenu(this.id,'bottom',0) title='{$lang->import}'");
echo '</span>';
common::printIcon('task', 'batchCreate', "projectID=$projectID");
common::printIcon('task', 'create', "project=$projectID");
?>
</div>
</div>
<div id='importActionMenu' class='listMenu hidden'>
<ul>
<?php
echo "<li>" . html::a($this->createLink('project', 'importTask', "project=$project->id"), $lang->project->importTask) . "</li>";
echo "<li>" . html::a($this->createLink('project', 'importBug', "projectID=$project->id"), $lang->project->importBug) . "</li>";
?>
</ul>
</div>
<?php foreach(glob(dirname(dirname(__FILE__)) . "/ext/view/featurebar.*.html.hook.php") as $fileName) include_once $fileName; ?>
+1 -9
View File
@@ -17,15 +17,7 @@
<?php js::set('holders', $lang->task->placeholder);?>
<form method='post' enctype='multipart/form-data' id='dataform' class='ajaxForm'>
<table align='center' class='table-1 a-left'>
<caption>
<?php echo $lang->task->create;?>
<div class='f-right'>
<?php
common::printLink('project', 'importTask', "project=$project->id", $lang->project->importTask);
common::printLink('project', 'importBug', "projectID=$project->id", $lang->project->importBug);
?>
</div>
</caption>
<caption><?php echo $lang->task->create;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->task->project;?></th>
<td><?php echo $project->name;?></td>
-1
View File
@@ -1,3 +1,2 @@
.w-220px{width:220px}
#featurebar .f-right .icon-green-testcase-import {padding:2px 8px; background:url(theme/default/images/main/zt-icons.png) 0px -82px;}
form {position:relative}
+1 -1
View File
@@ -38,8 +38,8 @@ js::set('confirmDelete', $lang->testcase->confirmDelete);
</div>
</div>
<div id='querybox' class='<?php if($browseType != 'bysearch') echo 'hidden';?>'></div>
<form id='batchForm' method='post'>
<div class='treeSlider'><span>&nbsp;</span></div>
<form id='batchForm' method='post'>
<table class='cont-lt1'>
<tr valign='top'>
<td class='side <?php echo $treeClass;?>'>