The dynamic "ENUM or SET data too long" behavior did not work inside the Create table dialog

This commit is contained in:
Marc Delisle
2010-12-28 15:23:14 -05:00
parent fa255cf2b4
commit 5476d289fa

View File

@@ -1652,6 +1652,7 @@ $(document).ready(function() {
.dialog({ .dialog({
title: PMA_messages['strCreateTable'], title: PMA_messages['strCreateTable'],
width: 900, width: 900,
open: PMA_verifyTypeOfAllColumns,
buttons : button_options buttons : button_options
}); // end dialog options }); // end dialog options
}) // end $.get() }) // end $.get()
@@ -2038,14 +2039,22 @@ $(document).ready(function() {
* the page loads and when the selected data type changes * the page loads and when the selected data type changes
*/ */
$(document).ready(function() { $(document).ready(function() {
$.each($("select[class='column_type']"), function() { // is called here for normal page loads and also when opening
toggle_enum_notice($(this)); // the Create table dialog
}); PMA_verifyTypeOfAllColumns();
$("select[class='column_type']").change(function() { //
// needs live() to work also in the Create Table dialog
$("select[class='column_type']").live('change', function() {
toggle_enum_notice($(this)); toggle_enum_notice($(this));
}); });
}); });
function PMA_verifyTypeOfAllColumns() {
$("select[class='column_type']").each(function() {
toggle_enum_notice($(this));
});
}
/** /**
* Closes the ENUM/SET editor and removes the data in it * Closes the ENUM/SET editor and removes the data in it
*/ */
@@ -2061,7 +2070,8 @@ function disable_popup() {
* Opens the ENUM/SET editor and controls its functions * Opens the ENUM/SET editor and controls its functions
*/ */
$(document).ready(function() { $(document).ready(function() {
$("a[class='open_enum_editor']").click(function() { // Needs live() to work also in the Create table dialog
$("a[class='open_enum_editor']").live('click', function() {
// Center the popup // Center the popup
var windowWidth = document.documentElement.clientWidth; var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight; var windowHeight = document.documentElement.clientHeight;
@@ -2100,22 +2110,26 @@ $(document).ready(function() {
}); });
// If the "close" link is clicked, close the enum editor // If the "close" link is clicked, close the enum editor
$("a[class='close_enum_editor']").click(function() { // Needs live() to work also in the Create table dialog
$("a[class='close_enum_editor']").live('click', function() {
disable_popup(); disable_popup();
}); });
// If the "cancel" link is clicked, close the enum editor // If the "cancel" link is clicked, close the enum editor
$("a[class='cancel_enum_editor']").click(function() { // Needs live() to work also in the Create table dialog
$("a[class='cancel_enum_editor']").live('click', function() {
disable_popup(); disable_popup();
}); });
// When "add a new value" is clicked, append an empty text field // When "add a new value" is clicked, append an empty text field
$("a[class='add_value']").click(function() { // Needs live() to work also in the Create table dialog
$("a[class='add_value']").live('click', function() {
$("#enum_editor #values").append("<input type='text' />"); $("#enum_editor #values").append("<input type='text' />");
}); });
// When the submit button is clicked, put the data back into the original form // When the submit button is clicked, put the data back into the original form
$("#enum_editor input[type='submit']").click(function() { // Needs live() to work also in the Create table dialog
$("#enum_editor input[type='submit']").live('click', function() {
var value_array = new Array(); var value_array = new Array();
$.each($("#enum_editor #values input"), function(index, input_element) { $.each($("#enum_editor #values input"), function(index, input_element) {
val = jQuery.trim(input_element.value); val = jQuery.trim(input_element.value);