From 7e3b4408cb2066f47537e486cd0a6e89bfa80826 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 23 Aug 2012 10:55:21 -0700 Subject: [PATCH] UI create form: Support custom checkbox 'on change' event If field is a checkbox (isBoolean: true) and onChange function is specified, then call this onChange everytime checkbox is clicked. --- ui/scripts/ui/dialog.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 86db690146c..88ffe57214e 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -273,6 +273,15 @@ }, 100); } } + + // Setup on click event + if (field.onChange) { + $input.click(function() { + field.onChange({ + $checkbox: $input + }); + }); + } } else if (field.dynamic) { // Generate a 'sub-create-form' -- append resulting fields $input = $('
').addClass('dynamic-input').appendTo($value);