From: Jagadedes Date: Thu, 23 Oct 2014 09:56:50 +0000 (+0530) Subject: review moved js code to seletate file X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0514c86aaaad2ec17d9aef933ca2dd62d50b7d76;p=com.zyxware.civiwci.git review moved js code to seletate file --- diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index 5e935c8..cdb62d8 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -3,30 +3,7 @@ require_once 'CRM/Core/Form.php'; require_once 'wci-helper-functions.php'; require_once 'CRM/Wci/BAO/ProgressBar.php'; -?> - - -addScriptFile('org.civicrm.wci', 'createwidget.js'); parent::preProcess(); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'REQUEST' ); diff --git a/createwidget.js b/createwidget.js new file mode 100644 index 0000000..9519b1f --- /dev/null +++ b/createwidget.js @@ -0,0 +1,20 @@ +// +cj(function ( $ ) { + function setState() { + if ($('#override').is(':checked') == true) { + $('#custom_template').attr("disabled",false); + } + else { + $('#custom_template').attr("disabled",true); + } + if( $('#title').val() != "") { + $('#embd_code').parents('.crm-section').show(); + } else { + $('#embd_code').parents('.crm-section').hide(); + } + } + $(document).ready(setState) + $('#override').click(setState); + +}); +