Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Delisle <marc@infomarc.info>2010-04-18 03:22:12 +0400
committerMarc Delisle <marc@infomarc.info>2010-04-18 03:22:12 +0400
commit5a75ca180ae0eb5c47a80428c7707cca6d5d1269 (patch)
tree6703fa81939689789f5f4d51c1ac5aac68fc04cd /js/tbl_relation.js
parentf3f41cbe78693781a9874c59a8ae736d324797bd (diff)
rfe #2988633 Improve ON DELETE/ON UPDATE drop-downs
Diffstat (limited to 'js/tbl_relation.js')
-rw-r--r--js/tbl_relation.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/tbl_relation.js b/js/tbl_relation.js
new file mode 100644
index 0000000000..5cdb0d7d9f
--- /dev/null
+++ b/js/tbl_relation.js
@@ -0,0 +1,26 @@
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * for tbl_relation.php
+ *
+ */
+function show_hide_clauses(thisDropdown) {
+ // here, one span contains the label and the clause dropdown
+ // and we have one span for ON DELETE and one for ON UPDATE
+ //
+ if (thisDropdown.val() != '') {
+ thisDropdown.parent().next('span').show().next('span').show();
+ } else {
+ thisDropdown.parent().next('span').hide().next('span').hide();
+ }
+}
+
+$(document).ready(function() {
+ // initial display
+ $('.referenced_column_dropdown').each(function(index, one_dropdown) {
+ show_hide_clauses($(one_dropdown));
+ });
+ // change
+ $('.referenced_column_dropdown').change(function() {
+ show_hide_clauses($(this));
+ });
+});