Repository: cloudstack Updated Branches: refs/heads/4.4 70cfbd3bb -> 379955837
CLOUDSTACK-7826: UI - dialog widget - dependent dropdown field (dependsOn property specified) - fix a bug that default opton in dependent dropdown field didn't trigger change event handler until another option in dependent dropdown field was selected. (cherry picked from commit 21f39577e439bd9a98bf8e9ffa0f0f7d329c5ce9) Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/479b550d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/479b550d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/479b550d Branch: refs/heads/4.4 Commit: 479b550d79877a57cb6369274ea1640b3f1f0b84 Parents: 70cfbd3 Author: Jessica Wang <jessicaw...@apache.org> Authored: Fri Oct 31 15:31:24 2014 -0700 Committer: Daan Hoogland <d...@onecht.net> Committed: Tue Nov 11 16:43:10 2014 +0100 ---------------------------------------------------------------------- ui/scripts/ui/dialog.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/479b550d/ui/scripts/ui/dialog.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 0fddcf7..4bd0361 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -235,7 +235,10 @@ if (($target.is(':checked') && !isReverse) || ($target.is(':unchecked') && isReverse)) { - $dependent.css('display', 'inline-block'); + + $dependent.css('display', 'inline-block'); //show dependent dropdown field + $dependent.change(); //trigger event handler for default option in dependent dropdown field (CLOUDSTACK-7826) + $dependent.each(function() { if ($(this).data('dialog-select-fn')) { $(this).data('dialog-select-fn')();