Skip to content

Commit

Permalink
checking for Fx.Scroll before it is invoked in FormValidator.Inline
Browse files Browse the repository at this point in the history
  • Loading branch information
anutron committed Mar 8, 2009
1 parent d039a59 commit 8d23310
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions Source/Forms/FormValidator.Inline.js
Expand Up @@ -40,19 +40,16 @@ FormValidator.Inline = new Class({
makeAdvice: function(className, field, error, warn){
var errorMsg = (warn)?this.warningPrefix:this.errorPrefix;
errorMsg += (this.options.useTitles) ? field.title || error:error;
var cssClass = (warn)?'warning-advice':'validation-advice';
var newAdvice = new Element('div', {
html: errorMsg,
styles: { display: 'none' },
id: 'advice-'+className+'-'+this.getFieldId(field)
}).addClass(cssClass);
var advice = this.getAdvice(className, field);
if (!advice){
var cssClass = (warn) ? 'warning-advice' : 'validation-advice';
advice = new Element('div', {
html: errorMsg,
styles: { display: 'none' },
id: 'advice-' + className + '-' + this.getFieldId(field)
}).addClass(cssClass);
} else{
advice.set('html', errorMsg);
}
field.store('advice-' + className, advice);
return advice;
if(advice) newAdvice.replaces(advice);
field.store('advice-'+className, newAdvice);
return newAdvice;
},

getFieldId : function(field){
Expand Down Expand Up @@ -146,7 +143,7 @@ FormValidator.Inline = new Class({
par = par.getParent();
};
var fx = par.retrieve('fvScroller');
if (!fx && window.Fx){
if (!fx && window.Fx && Fx.Scroll){
fx = new Fx.Scroll(par, {
transition: 'quad:out',
offset: {
Expand Down

0 comments on commit 8d23310

Please sign in to comment.