diff options
author | Michal Čihař <mcihar@suse.cz> | 2013-10-02 13:54:13 +0400 |
---|---|---|
committer | Michal Čihař <mcihar@suse.cz> | 2013-10-02 14:07:14 +0400 |
commit | 51bb5ffc3122f620cee74a5b8bc8e5815cd1f88b (patch) | |
tree | 028cfdd22c676432c0f2274e9386d396800654f4 /js/tbl_relation.js | |
parent | 5671039ba25c5e1797c931e8e25d79c9c3ebbd2b (diff) |
Coding style: Declare before used and add function comments
Diffstat (limited to 'js/tbl_relation.js')
-rw-r--r-- | js/tbl_relation.js | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/js/tbl_relation.js b/js/tbl_relation.js index 6527c6012a..d6ceb1dbd5 100644 --- a/js/tbl_relation.js +++ b/js/tbl_relation.js @@ -15,6 +15,20 @@ function show_hide_clauses($thisDropdown) } /** + * Sets dropdown options to values + */ +function setDropdownValues($dropdown, values) { + $dropdown.empty(); + var optionsAsString = ''; + // add an empty string to the beginning for empty selection + values.unshift(''); + $.each(values, function () { + optionsAsString += "<option value='" + this + "'>" + this + "</option>"; + }); + $dropdown.append($(optionsAsString)); +} + +/** * Retrieves and populates dropdowns to the left based on the selected value * * @param $dropdown the dropdown whose value got changed @@ -89,17 +103,6 @@ function getDropdownValues($dropdown) { }); } -function setDropdownValues($dropdown, values) { - $dropdown.empty(); - var optionsAsString = ''; - // add an empty string to the beginning for empty selection - values.unshift(''); - $.each(values, function () { - optionsAsString += "<option value='" + this + "'>" + this + "</option>"; - }); - $dropdown.append($(optionsAsString)); -} - /** * Unbind all event handlers before tearing down a page */ |