فهرست منبع

fixed edit form submit on Enter

Piotr Labudda 8 سال پیش
والد
کامیت
388b5b7f3a
2فایلهای تغییر یافته به همراه16 افزوده شده و 18 حذف شده
  1. 5 7
      SE/se-lib/Route/ViewTableAjax.php
  2. 11 11
      SE/se-lib/TableAjax.php

+ 5 - 7
SE/se-lib/Route/ViewTableAjax.php

@@ -515,6 +515,10 @@ class Route_ViewTableAjax extends RouteBase {
 
 		$jsGui = [
 			'reactNode' => [ 'div', [ 'class' => "container AjaxFrmHorizontalEdit", 'style' => [ "max-width" => "940px" ] ], [
+				[ 'h4', [ 'style' => [ "padding-bottom" => "3px", "border-bottom" => "1px solid #ddd" ] ], [
+					"Edycja rekordu Nr {$record['ID']}",
+					[ 'small', [ 'class' => "pull-right valign-btns-bottom" ], [ $rowFunctionsOut ] ],
+				] ],
 				[ 'P5UI__FeatureEditForm', [
 					'class' => "form-horizontal", 'action' => "", 'method' => "post",
 					'id' => "EDIT_FRM_{$this->_htmlID}", // TODO: rm - use React nodes // TODO: $this->_htmlID not exists!
@@ -523,13 +527,7 @@ class Route_ViewTableAjax extends RouteBase {
 					'idRecord' => $record['ID'],
 					'tableLabelHtml' => $tblLabel,
 				], [
-					[ 'fieldset', [ 'style' => [ "padding-bottom" => "100px" ] ], array_merge([
-						[ 'legend', [], [
-							"Edycja rekordu Nr {$record['ID']}",
-							[ 'span', [ 'class' => "pull-right valign-btns-bottom" ], [ $rowFunctionsOut ] ],
-						] ] ],
-						$jsFields
-					)] // fieldset
+					[ 'fieldset', [ 'style' => [ "padding-bottom" => "100px" ] ], $jsFields ] // fieldset
 				] ] // form
 			] ] // .container
 		];

+ 11 - 11
SE/se-lib/TableAjax.php

@@ -152,11 +152,11 @@ class TableAjax extends ViewAjax {
 	public function setRowFunctions($functions) {
 		$this->_rowFunctions = [];
 		$defaultRowFunction = array();
-		$defaultRowFunction['edit'] = array('href'=>'#EDIT/{0}', 'ico'=>'glyphicon glyphicon-pencil', 'title'=>'Edytuj rekord');
-		$defaultRowFunction['hist'] = array('href'=>'#HIST/{0}', 'ico'=>'glyphicon glyphicon-book', 'title'=>'Historia');
-		$defaultRowFunction['files'] = array('href'=>'#FILES/{0}', 'ico'=>'glyphicon glyphicon-folder-open', 'title'=>'Pliki');
-		$defaultRowFunction['cp'] = array('href'=>'#', 'ico'=>'glyphicon glyphicon-plus-sign', 'title'=>'Kopiuj rekord', 'onclick'=>'return tableAjaxCopy({0});');
-		$defaultRowFunction['msgs'] = array('href'=>"index.php?_route=TableMsgs&_task=tableRow&idTable={$this->_zasobID}&idRow={0}", 'ico'=>'glyphicon glyphicon-envelope', 'title'=>'Wiadomości');
+		$defaultRowFunction['edit'] = [ 'href'=>'#EDIT/{0}', 'ico'=>'glyphicon glyphicon-pencil', 'title'=>'Edytuj rekord', 'class' => "btn btn-xs btn-link" ];
+		$defaultRowFunction['hist'] = [ 'href'=>'#HIST/{0}', 'ico'=>'glyphicon glyphicon-book', 'title'=>'Historia', 'class' => "btn btn-xs btn-link" ];
+		$defaultRowFunction['files'] = [ 'href'=>'#FILES/{0}', 'ico'=>'glyphicon glyphicon-folder-open', 'title'=>'Pliki', 'class' => "btn btn-xs btn-link" ];
+		$defaultRowFunction['cp'] = [ 'href'=>'#', 'ico'=>'glyphicon glyphicon-plus-sign', 'title'=>'Kopiuj rekord', 'onclick'=>'return tableAjaxCopy({0});', 'class' => "btn btn-xs btn-link" ];
+		$defaultRowFunction['msgs'] = [ 'href'=>"index.php?_route=TableMsgs&_task=tableRow&idTable={$this->_zasobID}&idRow={0}", 'ico'=>'glyphicon glyphicon-envelope', 'title'=>'Wiadomości', 'class' => "btn btn-xs btn-link" ];
 
 		foreach ($functions as $funName => $params) {
 			if (true === $params) {
@@ -180,11 +180,11 @@ class TableAjax extends ViewAjax {
 		//$defaultRowFunction['files'] = '<a href="#FILES/{0}" class="glyphicon glyphicon-folder-open" title="Pliki"></a>';
 		//$defaultRowFunction['cp'] = '<a href="#" class="glyphicon glyphicon-plus-sign" title="Kopiuj rekord" onclick="return tableAjaxCopy({0});"></a>';
 
-		$defaultRowFunction['edit'] = array('href'=>'#EDIT/{0}', 'ico'=>'glyphicon glyphicon-pencil', 'title'=>'Edytuj rekord');
-		$defaultRowFunction['hist'] = array('href'=>'#HIST/{0}', 'ico'=>'glyphicon glyphicon-book', 'title'=>'Historia');
-		$defaultRowFunction['files'] = array('href'=>'#FILES/{0}', 'ico'=>'glyphicon glyphicon-folder-open', 'title'=>'Pliki');
-		$defaultRowFunction['cp'] = array('href'=>'#', 'ico'=>'glyphicon glyphicon-plus-sign', 'title'=>'Kopiuj rekord', 'onclick'=>'return tableAjaxCopy({0});');
-		$defaultRowFunction['msgs'] = array('href'=>"index.php?_route=TableMsgs&_task=tableRow&idTable={$this->_zasobID}&idRow={0}", 'ico'=>'glyphicon glyphicon-envelope', 'title'=>'Wiadomości');
+		$defaultRowFunction['edit'] = [ 'href'=>'#EDIT/{0}', 'ico'=>'glyphicon glyphicon-pencil', 'title'=>'Edytuj rekord', 'class' => "btn btn-xs btn-link" ];
+		$defaultRowFunction['hist'] = [ 'href'=>'#HIST/{0}', 'ico'=>'glyphicon glyphicon-book', 'title'=>'Historia', 'class' => "btn btn-xs btn-link" ];
+		$defaultRowFunction['files'] = [ 'href'=>'#FILES/{0}', 'ico'=>'glyphicon glyphicon-folder-open', 'title'=>'Pliki', 'class' => "btn btn-xs btn-link" ];
+		$defaultRowFunction['cp'] = [ 'href'=>'#', 'ico'=>'glyphicon glyphicon-plus-sign', 'title'=>'Kopiuj rekord', 'onclick'=>'return tableAjaxCopy({0});', 'class' => "btn btn-xs btn-link" ];
+		$defaultRowFunction['msgs'] = [ 'href'=>"index.php?_route=TableMsgs&_task=tableRow&idTable={$this->_zasobID}&idRow={0}", 'ico'=>'glyphicon glyphicon-envelope', 'title'=>'Wiadomości', 'class' => "btn btn-xs btn-link" ];
 
 		if (array_key_exists($funName, $defaultRowFunction)) {
 			$this->_rowFunctions[$funName] = $defaultRowFunction[$funName];
@@ -385,7 +385,7 @@ class TableAjax extends ViewAjax {
 			.ui-dialog-content .mapEditor-btnBackToWindowItemInactive,
 			.ui-dialog-content .mapEditor-btnBackToWindowItemActive { display:none; }
 
-			.AjaxTableCont .valign-btns-bottom a { vertical-align:text-bottom; font-weight:normal; font-size:12px; line-height:14px; }
+			.AjaxTableCont .valign-btns-bottom .btn { vertical-align:text-bottom; font-weight:normal; font-size:12px; line-height:14px; }
 
 			.ui-resizable-s { bottom:0; }
 			.ui-resizable-e { right:0; }