The branch, master has been updated
via b131ec75ba6db8f33bf0f6af1190f03525e5f8a0 (commit)
from 0ded8da4858a92bcda776e7db4b973eaa815adaf (commit)
- Log -----------------------------------------------------------------
commit b131ec75ba6db8f33bf0f6af1190f03525e5f8a0
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Wed Nov 16 14:29:14 2011 +0000
Improved layout for the data editor from the zoom search feature
-----------------------------------------------------------------------
Summary of changes:
js/tbl_zoom_plot.js | 49 ++++++++++++++++++++-----------
tbl_zoom_select.php | 12 ++------
themes/original/css/theme_right.css.php | 8 +++++
themes/pmahomme/css/theme_right.css.php | 8 +++++
4 files changed, 51 insertions(+), 26 deletions(-)
diff --git a/js/tbl_zoom_plot.js b/js/tbl_zoom_plot.js
index ce3de9d..4fad9c8 100644
--- a/js/tbl_zoom_plot.js
+++ b/js/tbl_zoom_plot.js
@@ -248,23 +248,11 @@ $(document).ready(function() {
/**
** Set dialog properties for the data display form
**/
- $("#dataDisplay").dialog({
- autoOpen: false,
- title: 'Data point content',
- modal: false, //false otherwise other dialogues like timepicker may not function
properly
- height: $('#dataDisplay').height() + 80,
- width: $('#dataDisplay').width() + 80
- });
-
+ var buttonOptions = {};
/*
- * Handle submit of zoom_display_form
+ * Handle saving of a row in the editor
*/
-
- $("#submitForm").click(function(event) {
-
- //Prevent default submission of form
- event.preventDefault();
-
+ buttonOptions[PMA_messages['strSave']] = function () {
//Find changed values by comparing form values with selectedRow Object
var newValues = new Object();//Stores the values changed from original
var sqlTypes = new Object();
@@ -461,8 +449,35 @@ $(document).ready(function() {
}
}); //End $.post
}//End database update
- $("#dataDisplay").dialog("close");
- });//End submit handler
+ $("#dataDisplay").dialog('close');
+ };
+ buttonOptions[PMA_messages['strCancel']] = function () {
+ $(this).dialog('close');
+ };
+ $("#dataDisplay").dialog({
+ autoOpen: false,
+ title: 'Data point content',
+ modal: true,
+ buttons: buttonOptions,
+ width: $('#dataDisplay').width() + 24,
+ open: function () {
+ $(this).find('input[type=checkbox]').css('margin',
'0.5em');
+ }
+ });
+ /**
+ * Attach Ajax event handlers for input fields
+ * in the dialog. Used to submit the Ajax
+ * request when the ENTER key is pressed.
+ */
+ $("#dataDisplay").find(':input').live('keydown', function
(e) {
+ if (e.which === 13) { // 13 is the ENTER key
+ e.preventDefault();
+ if (typeof buttonOptions[PMA_messages['strSave']] ===
'function') {
+ buttonOptions[PMA_messages['strSave']].call();
+ }
+ }
+ });
+
/*
* Generate plot using Highcharts
diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php
index 739a509..52293b1 100644
--- a/tbl_zoom_select.php
+++ b/tbl_zoom_select.php
@@ -426,9 +426,8 @@ if (isset($zoom_submit) && $inputs[0] != 'pma_null'
&& $inputs[1] != 'pma_null'
}
?>
</center>
- <fieldset id='dataDisplay' style="display:none">
- <fieldset>
- <table class="data">
+ <div id='dataDisplay' style="display:none">
+ <table>
<thead>
<tr>
<th> <?php echo __('Column'); ?> </th>
@@ -464,12 +463,7 @@ if (isset($zoom_submit) && $inputs[0] != 'pma_null'
&& $inputs[1] != 'pma_null'
?>
</tbody>
</table>
- </fieldset>
- <fieldset class="tblFooters">
- <input type="submit" id="submitForm"
name="edit_point" value="<?php echo __('Submit'); ?>"
/>
- </fieldset>
- </fieldset>
- </fieldset>
+ </div>
<input type="hidden" id="queryID" name="sql_query"
/>
</form>
<?php
diff --git a/themes/original/css/theme_right.css.php
b/themes/original/css/theme_right.css.php
index eab4ec1..1284ae1 100644
--- a/themes/original/css/theme_right.css.php
+++ b/themes/original/css/theme_right.css.php
@@ -810,6 +810,14 @@ a.error {
<?php } ?>
/* end topmenu */
+/* zoom search */
+div#dataDisplay input, div#dataDisplay select {
+ margin: 0;
+ margin-<?php echo $right; ?>: 0.5em;
+}
+div#dataDisplay th {
+ line-height: 2em;
+}
/* Calendar */
table.calendar {
diff --git a/themes/pmahomme/css/theme_right.css.php
b/themes/pmahomme/css/theme_right.css.php
index aa0f27b..db300f3 100644
--- a/themes/pmahomme/css/theme_right.css.php
+++ b/themes/pmahomme/css/theme_right.css.php
@@ -1020,6 +1020,14 @@ a.error {
<?php } ?>
/* end topmenu */
+/* zoom search */
+div#dataDisplay input, div#dataDisplay select {
+ margin: 0;
+ margin-<?php echo $right; ?>: 0.5em;
+}
+div#dataDisplay th {
+ line-height: 2em;
+}
/* Calendar */
table.calendar {
hooks/post-receive
--
phpMyAdmin