mirror of
https://github.com/vrana/adminer.git
synced 2025-08-13 18:14:07 +02:00
Delete length when changing type
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1272 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -146,11 +146,18 @@ function editing_remove_row(button) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var last_type = '';
|
||||
function editing_type_change(type) {
|
||||
var name = type.name.substr(0, type.name.length - 6);
|
||||
var text = select_value(type);
|
||||
for (var i=0; i < type.form.elements.length; i++) {
|
||||
var el = type.form.elements[i];
|
||||
if (el.name == name + '[length]' && !(
|
||||
(/(char|binary)$/.test(last_type) && /(char|binary)$/.test(text))
|
||||
|| (/(enum|set)$/.test(last_type) && /(enum|set)$/.test(text))
|
||||
)) {
|
||||
el.value = '';
|
||||
}
|
||||
if (el.name == name + '[collation]') {
|
||||
el.className = (/(char|text|enum|set)$/.test(text) ? '' : 'hidden');
|
||||
}
|
||||
|
Reference in New Issue
Block a user