PDA

View Full Version : [FIXED][3.0] DateField



stever
7 Apr 2009, 12:44 PM
In DateField, this function checks to see if a value is set to true, after which it sets it to true. Wait, huh? I think the author meant to have a NOT (!) operator in there. But since the code has never likely been tested since the condition never happens, I'm not sure what other problems it will have one fixed... it does on('select', ...) twice, etc. I think someone needs to have another look at this class.


onMenuHide: function(){
if(this.afterInitial){
this.afterInitial = true;
this.focus.defer(10, this);
this.menuEvents('un');
}
},

mjlecomte
7 Apr 2009, 12:48 PM
Haven't looked at it, but it could have been set to something besides false/undefined, and someone wants to typecast it explicitly to boolean true also.

stever
7 Apr 2009, 1:43 PM
I did a grep though all the source code and examples, and this is the only place it is found. I should have mentioned that before. My bad.

aconran
7 Apr 2009, 1:59 PM
Thanks for bringing this to our attention, we'll have a look.

evant
7 Apr 2009, 3:35 PM
Fixed, something a bit more sane is committed.

stever
7 Apr 2009, 3:47 PM
I am using DateField as a model for a ColorField, and was wondering what the reasoning is behind the turning off the event listeners when the menu is hidden? Not that it doesn't make sense, just that I don't see it happen elsewhere as a general pattern. Or I missed it. Could be that too...