Open arogachev opened 7 years ago
I think these are internal things so probably should not be exposed at all...
@samdark Even it's rare case and this setup can be sufficient for the majority of the users, I think configuring them can be useful. User may want to remove some elements (in case of some conflicts with existing JS maybe):
yii.changeableSelector: 'select, input'
or have general setup based on classes:
yii.clickableSelector = 'clickable';
yii.changeableSelector = 'changeable';
OK. That won't hurt at least. I'm fine having these.
I found this issue during writing tests for
yii.js
.We have these 2 properties in
window.yii
:Even they are publicly accessible and settable through
window.yii
, custom values will have no effect.yii.js
, becausewindow.yii
is not defined at this point and this will lead toReferenceError: yii is not defined
. There is also a chance that dependentjQuery.js
will not be loaded at this moment too.yii.js
was loaded it will have no effect because according event handlers were already set:The releavant code immediately called right on when document is ready:
And event handlers will stay bound to elements found by initial selector.
So we need either to make them configurable or not expose it as public variables because it does not make sense.
P.S. This does not apply to
reloadableScripts
property because it's checked everytime inisReloadable()
function.