} else {
$('#embd_code').parents('.crm-section').hide();
}
-// $('#embd_code').attr("disabled",true);
}
$(document).ready(setState)
$('#override').click(setState);
-/*
- $("input[name='_qf_CreateWidget_savenprev']").on('click', function( e ) {
- e.preventDefault();
- alert( document.title );
-
- });*/
});
</script>
function setDefaultValues() {
$defaults = array();
-
- $defaults['size_variant'] = 'normal';
- foreach ($this->_colorFields as $name => $val) {
- $defaults[$name] = $val[3];
+ if (!isset($this->_id)) {
+ $defaults['size_variant'] = 'normal';
+ foreach ($this->_colorFields as $name => $val) {
+ $defaults[$name] = $val[3];
+ }
}
-
return $defaults;
}
),
));
- // $this->add('textarea', 'embd_code', ts('Code to embed:'));
-
// export form elements
$this->assign('elementNames', $this->getRenderableElementNames());
$elem->setValue($output);
}
}
- // $widget_controller_path = getWciWidgetControllerPath();
- //
- // $emb_code = "<script src=\"http://code.jquery.com/jquery-1.9.1.min.js\"></script>
-// <script type=\"text/javascript\" src=\"" . $widget_controller_path . "?widgetId=" . $this->_id . "\"></script>
-// <script>
-// $( document ).ready(function() {
-// $('#widgetwci').html(wciwidgetcode);
-// });
-// </script>
-// <div id='widgetwci'>
-// </div>";
- // $this->getElement('embd_code')->setValue($emb_code);
}
else {
/** Keep template in civicrm-wci/templates folder*/