From 5795664bd242b9ded1d64d52d2c804bbbee84045 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 22 Oct 2013 11:19:23 -0700 Subject: [PATCH] CLOUDSTACK-4925: UI > dialog widget > extend isChecked property to take function type (it takes only boolean type before this check-in). --- ui/scripts/ui/dialog.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 7bd203414b6..3d34203ee9d 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() {