New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #1065. CJuiSliderInput is now more customizable. #1685
Conversation
new CJavaScriptExpression('function(event, ui) { jQuery(\'#'. $idHidden .'\').val(ui.value); }'); | ||
|
||
$options=empty($this->options) ? '' : CJavaScript::encode($this->options); | ||
|
||
$js = "jQuery('#{$id}_slider').slider($options);\n"; | ||
Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$id, $js); | ||
Yii::app()->getClientScript()->registerScript('CJuiSliderInput#'.$id, $js); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__CLASS__
is a kind of reflection. Reflections are relatively slow, so i've removed it at all.
new CJavaScriptExpression('function(event, ui) { jQuery(\'#'. $idHidden .'\').val(ui.value); }'); | ||
$this->options[$this->event]=$isRange | ||
? new CJavaScriptExpression("function(e,ui){ v=ui.values; jQuery('#{$idHidden}').val(v[0]); jQuery('#{$idHidden}{$this->idEndSuffix}').val(v[1]); }") | ||
: new CJavaScriptExpression('function(event, ui) { jQuery(\'#'. $idHidden .'\').val(ui.value); }'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better readability.
Overall code looks OK. Haven't got a chance to check it in action yet. |
…lveNameID() method. [ci skip]
@resurtm let's update strings to 1.1.14 and merge it. |
Merged manually: d698526...b7a1d14 |
Fixes #1065. CJuiSliderInput is now more customizable.
BC and API are okay.
Testing code:
After submitting form above following ouput will happen:
Generated HTML:
Generated JS: