Updated Branches: refs/heads/master b04b6a0fb -> 5795664bd
CLOUDSTACK-4925: UI > dialog widget > extend isChecked property to take function type (it takes only boolean type before this check-in). Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5795664b Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5795664b Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5795664b Branch: refs/heads/master Commit: 5795664bd242b9ded1d64d52d2c804bbbee84045 Parents: b04b6a0 Author: Jessica Wang <[email protected]> Authored: Tue Oct 22 11:19:23 2013 -0700 Committer: Jessica Wang <[email protected]> Committed: Tue Oct 22 11:31:28 2013 -0700 ---------------------------------------------------------------------- ui/scripts/ui/dialog.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5795664b/ui/scripts/ui/dialog.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 7bd2034..3d34203 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -376,8 +376,14 @@ name: key, type: 'checkbox' }).appendTo($value); - if (field.isChecked) { - $input.attr('checked', strOrFunc(field.isChecked)); + var isChecked; + if (typeof (field.isChecked) == 'function') { + isChecked = field.isChecked(); + } else { + isChecked = field.isChecked; + } + if (isChecked) { + $input.attr('checked', strOrFunc(field.isChecked)); } else { // This is mainly for IE compatibility setTimeout(function() {
