db_central_columns: new column collapsing issue

Signed-off-by: Piyush Agrawal <poush12@gmail.com>
This commit is contained in:
Piyush Agrawal 2017-01-31 21:50:59 +05:30 committed by Michal Čihař
parent 9b534e55ca
commit b575f7ef1b
5 changed files with 14 additions and 5 deletions

View File

@ -100,7 +100,7 @@ if (PMA_isValid($_REQUEST['pos'], 'integer')) {
} else {
$pos = 0;
}
$addNewColumn = PMA_getHTMLforAddNewColumn($db);
$addNewColumn = PMA_getHTMLforAddNewColumn($db, $total_rows);
$response->addHTML($addNewColumn);
if ($total_rows <= 0) {
$response->addHTML(

View File

@ -1252,16 +1252,18 @@ function PMA_handleColumnExtra(&$columns_list)
/**
* build html for adding a new user defined column to central list
*
* @param string $db current database
* @param string $db current database
* @param integer $total_rows number of rows in central columns
*
* @return string html of the form to let user add a new user defined column to the
* list
*/
function PMA_getHTMLforAddNewColumn($db)
function PMA_getHTMLforAddNewColumn($db, $total_rows)
{
$addNewColumn = '<div id="add_col_div" class="topmargin"><a href="#">'
. '<span>+</span> ' . __('Add new column') . '</a>'
. '<form id="add_new" style="min-width:100%;display:none" '
. '<form id="add_new" class="new_central_col '
. ($total_rows != 0 ? 'hide"' : '"')
. 'method="post" action="db_central_columns.php">'
. URL::getHiddenInputs(
$db

View File

@ -532,7 +532,7 @@ class PMA_Central_Columns_Test extends PHPUnit_Framework_TestCase
*/
public function testPMAGetHTMLforAddNewColumn()
{
$result = PMA_getHTMLforAddNewColumn('phpmyadmin');
$result = PMA_getHTMLforAddNewColumn('phpmyadmin', 0);
$this->assertContains(
'<form',
$result

View File

@ -495,6 +495,9 @@ fieldset.confirmation legend {
}
/* end messageboxes */
.new_central_col{
width: 100%;
}
.tblcomment {
font-size: 70%;

View File

@ -786,6 +786,10 @@ fieldset.confirmation legend {
/* end messageboxes */
.new_central_col{
width: 100%;
}
.tblcomment {
font-size: 70%;
font-weight: normal;