Skip to content

Commit

Permalink
Fix for exception in IE with new imageandtextview code.
Browse files Browse the repository at this point in the history
Reviewed by me.
  • Loading branch information
Francisco Ryan Tolmasky I committed Jan 28, 2009
1 parent f73c569 commit f0defa1
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions AppKit/_CPImageAndTextView.j
Expand Up @@ -373,18 +373,24 @@ var HORIZONTAL_MARGIN = 3.0,

var shadowStyle = _DOMTextShadowElement.style;

shadowStyle.font = textStyle.font;
shadowStyle.font = [_font ? _font : [CPFont systemFontOfSize:12.0] cssString];
shadowStyle.position = "absolute";
shadowStyle.whiteSpace = textStyle.whiteSpace;
shadowStyle.cursor = "default";
shadowStyle.zIndex = -100;
shadowStyle.overflowX = textStyle.overflowX;
shadowStyle.overflowY = textStyle.overflowY;
shadowStyle.textOverflow = textStyle.textOverflow;

if (document.attachEvent)
shadowStyle.wordWrap = textStyle.wordWrap;

{
shadowStyle.overflow = textStyle.overflow;
shadowStyle.wordWrap = textStyle.wordWrap;
}
else
{
shadowStyle.overflowX = textStyle.overflowX;
shadowStyle.overflowY = textStyle.overflowY;
}

_DOMElement.appendChild(_DOMTextShadowElement);

hasDOMTextShadowElement = YES;
Expand Down Expand Up @@ -415,10 +421,11 @@ var HORIZONTAL_MARGIN = 3.0,

if (_flags & _CPImageAndTextViewFontChangedFlag)
{
textStyle.font = [_font ? _font : [CPFont systemFontOfSize:12.0] cssString];
var fontStyle = [_font ? _font : [CPFont systemFontOfSize:12.0] cssString];
textStyle.font = fontStyle;

if (shadowStyle)
shadowStyle.font = textStyle.font;
shadowStyle.font = fontStyle;
}

// Update the line break mode if necessary.
Expand Down Expand Up @@ -471,11 +478,17 @@ var HORIZONTAL_MARGIN = 3.0,
if (shadowStyle)
{
if (document.attachEvent)
shadowStyle.wordWrap = textStyle.wordWrap;

{
shadowStyle.wordWrap = textStyle.wordWrap;
shadowStyle.overflow = textStyle.overflow;
}
else
{
shadowStyle.overflowX = textStyle.overflowX;
shadowStyle.overflowY = textStyle.overflowY;
}

shadowStyle.whiteSpace = textStyle.whiteSpace;
shadowStyle.overflowX = textStyle.overflowX;
shadowStyle.overflowY = textStyle.overflowY;
shadowStyle.textOverflow = textStyle.textOverflow;
}
}
Expand Down

0 comments on commit f0defa1

Please sign in to comment.