Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2466010DA1 for ; Tue, 22 Oct 2013 18:21:46 +0000 (UTC) Received: (qmail 51047 invoked by uid 500); 22 Oct 2013 18:20:56 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 50839 invoked by uid 500); 22 Oct 2013 18:20:46 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 50816 invoked by uid 99); 22 Oct 2013 18:20:43 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Oct 2013 18:20:43 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B014D50EA8; Tue, 22 Oct 2013 18:20:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jessicawang@apache.org To: commits@cloudstack.apache.org Message-Id: <794b9772fd0f42599eb7d4e1d72580fa@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.2 to 5ca5cb1 Date: Tue, 22 Oct 2013 18:20:43 +0000 (UTC) Updated Branches: refs/heads/4.2 3b28f73be -> 5ca5cb190 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/5ca5cb19 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5ca5cb19 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5ca5cb19 Branch: refs/heads/4.2 Commit: 5ca5cb1903b5904f8fed18108bfab8b9c7bee863 Parents: 3b28f73 Author: Jessica Wang Authored: Tue Oct 22 11:19:23 2013 -0700 Committer: Jessica Wang Committed: Tue Oct 22 11:20:32 2013 -0700 ---------------------------------------------------------------------- ui/scripts/ui/dialog.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5ca5cb19/ui/scripts/ui/dialog.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 4bbaf9c..ff60865 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -368,11 +368,17 @@ }); } else { - $input = $('').attr({ - name: key, - type: 'checkbox' - }).appendTo($value); - if (field.isChecked) { + $input = $('').attr({ + name: key, + type: 'checkbox' + }).appendTo($value); + var isChecked; + if (typeof (field.isChecked) == 'function') { + isChecked = field.isChecked(); + } else { + isChecked = field.isChecked; + } + if (isChecked) { $input.attr('checked', 'checked'); } else { // This is mainly for IE compatibility