Skip to content

Commit

Permalink
Form.Validator: only element storage validator should be public
Browse files Browse the repository at this point in the history
  • Loading branch information
Arian committed Jul 16, 2010
1 parent b5acb26 commit 4dd3628
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Source/Forms/Form.Validator.Inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ Form.Validator.Inline = new Class({
while (par != document.body && par.getScrollSize().y == par.getSize().y){
par = par.getParent();
}
var fx = par.retrieve('fvScroller');
var fx = par.retrieve('$moo:fvScroller');
if (!fx && window.Fx && Fx.Scroll){
fx = new Fx.Scroll(par, this.options.scrollFxOptions);
par.store('fvScroller', fx);
par.store('$moo:fvScroller', fx);
}
if (failed){
if (fx) fx.toElement(failed);
Expand Down
20 changes: 10 additions & 10 deletions Source/Forms/Form.Validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ var InputValidator = new Class({
Element.Properties.validatorProps = {

set: function(props){
return this.eliminate('validatorProps').store('validatorProps', props);
return this.eliminate('$moo:validatorProps').store('$moo:validatorProps', props);
},

get: function(props){
if (props) this.set(props);
if (this.retrieve('validatorProps')) return this.retrieve('validatorProps');
if (this.getProperty('validatorProps')){
if (this.retrieve('$moo:validatorProps')) return this.retrieve('$moo:validatorProps');
if (this.getProperty('$moo:validatorProps')){
try {
this.store('validatorProps', JSON.decode(this.getProperty('validatorProps')));
this.store('$moo:validatorProps', JSON.decode(this.getProperty('$moo:validatorProps')));
}catch(e){
return {};
}
Expand All @@ -84,7 +84,7 @@ Element.Properties.validatorProps = {
return cls.test(':');
});
if (!vals.length){
this.store('validatorProps', {});
this.store('$moo:validatorProps', {});
} else {
props = {};
vals.each(function(cls){
Expand All @@ -95,10 +95,10 @@ Element.Properties.validatorProps = {
} catch(e) {}
}
});
this.store('validatorProps', props);
this.store('$moo:validatorProps', props);
}
}
return this.retrieve('validatorProps');
return this.retrieve('$moo:validatorProps');
}

};
Expand Down Expand Up @@ -471,13 +471,13 @@ Element.Properties.validator = {
set: function(options){
var validator = this.retrieve('validator');
if (validator) validator.setOptions(options);
return this.store('validator:options');
return this.store('$moo:validator:options');
},

get: function(options){
if (options || !this.retrieve('validator')){
if (options || !this.retrieve('validator:options')) this.set('validator', options);
this.store('validator', new Form.Validator(this, this.retrieve('validator:options')));
if (options || !this.retrieve('$moo:validator:options')) this.set('validator', options);
this.store('validator', new Form.Validator(this, this.retrieve('$moo:validator:options')));
}
return this.retrieve('validator');
}
Expand Down

0 comments on commit 4dd3628

Please sign in to comment.