diff options
author | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-07-13 12:44:15 +0300 |
---|---|---|
committer | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-07-13 12:44:15 +0300 |
commit | a3285a7cd3d2b1345019f4b53d0a4a0b0f4d4c06 (patch) | |
tree | e5a495a880f358fa2f41f9250d7e671dd96d8b7c /js/functions.js | |
parent | 8634d9d086f955f1308a148801a7763abd2a9f4d (diff) |
Support MySQL 5.7.5 virtual columns
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Diffstat (limited to 'js/functions.js')
-rw-r--r-- | js/functions.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/functions.js b/js/functions.js index 092490daea..531994079a 100644 --- a/js/functions.js +++ b/js/functions.js @@ -230,6 +230,21 @@ function PMA_hideShowDefaultValue($default_type) } /** + * Hides/shows the input field for column expression based on whether + * VIRTUAL/PERSISTENT is selected + * + * @param $virtuality virtuality dropdown + */ +function PMA_hideShowExpression($virtuality) +{ + if ($virtuality.val() == '') { + $virtuality.siblings('.expression').hide(); + } else { + $virtuality.siblings('.expression').show(); + } +} + +/** * Show notices for ENUM columns; add/hide the default value * */ @@ -241,6 +256,9 @@ function PMA_verifyColumnsProperties() $("select.default_type").each(function () { PMA_hideShowDefaultValue($(this)); }); + $('select.virtuality').each(function () { + PMA_hideShowExpression($(this)); + }); } /** @@ -3035,6 +3053,7 @@ AJAX.registerOnload('functions.js', function () { AJAX.registerTeardown('functions.js', function () { $(document).off('change', "select.column_type"); $(document).off('change', "select.default_type"); + $(document).off('change', "select.virtuality"); $(document).off('change', 'input.allow_null'); $(document).off('change', '.create_table_form select[name=tbl_storage_engine]'); }); @@ -3054,6 +3073,9 @@ AJAX.registerOnload('functions.js', function () { $(document).on('change', "select.default_type", function () { PMA_hideShowDefaultValue($(this)); }); + $(document).on('change', "select.virtuality", function () { + PMA_hideShowExpression($(this)); + }); $(document).on('change', 'input.allow_null', function () { PMA_validateDefaultValue($(this)); }); |