Permalink
Browse files

refs #10840: ignore invalid arguments error in IE when setting fontFa…

…milty

this happens in some cases if textbox is used in dialog
  • Loading branch information...
1 parent 7d22668 commit 2815aa59afb110d18aede4977cc78d53fe1f9147 @liucougar liucougar committed Aug 10, 2011
Showing with 10 additions and 7 deletions.
  1. +10 −7 form/TextBox.js
View
@@ -122,15 +122,18 @@ define([
setTimeout(lang.hitch(this, function(){
var s = domStyle.getComputedStyle(this.domNode);
if(s){
- var ff = s.fontFamily;
- if(ff){
- var inputs = this.domNode.getElementsByTagName("INPUT");
- if(inputs){
- for(var i=0; i < inputs.length; i++){
- inputs[i].style.fontFamily = ff;
+ try{
+ var ff = s.fontFamily;
+ if(ff){
+ var inputs = this.domNode.getElementsByTagName("INPUT");
+ if(inputs){
+ for(var i=0; i < inputs.length; i++){
+ inputs[i].style.fontFamily = ff;
+ }
}
}
- }
+ }catch(e){/*when used in a Dialog, and this is called before the dialog is
+ shown, s.fontFamily would trigger "Invalid Argument" error.*/}
}
}), 0);
}

0 comments on commit 2815aa5

Please sign in to comment.