Skip to content

Commit

Permalink
the change in opacity is now *added* to the original styles instead o…
Browse files Browse the repository at this point in the history
…f replacing, so that positioning and other attributes won't get affected

Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information
Simone Manganelli authored and rentzsch committed Apr 22, 2009
1 parent 9687059 commit dde839f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,14 @@ - (id) initWithArguments:(NSDictionary *)arguments
[originalOpacityDict setObject:[self.container getAttribute:@"style"] forKey:@"self-style"];
[originalOpacityDict setObject:[(DOMElement *)[self.container parentNode] getAttribute:@"style"] forKey:@"parent-style"];
self.originalOpacityAttributes = originalOpacityDict;


NSString *opacityResetString = @"; opacity: 1.000 !important; -moz-opacity: 1 !important; filter: alpha(opacity=1) !important;";
NSString *newSelfStyleString = [[self.originalOpacityAttributes objectForKey:@"self-style"] stringByAppendingString:opacityResetString];
NSString *newParentStyleString = [[self.originalOpacityAttributes objectForKey:@"parent-style"] stringByAppendingString:opacityResetString];

[self.container setAttribute:@"wmode" value:@"opaque"];
[self.container setAttribute:@"style" value:@"opacity: 1.000 !important; -moz-opacity: 1 !important; filter: alpha(opacity=1) !important;"];
[(DOMElement *)[self.container parentNode] setAttribute:@"style" value:@"opacity: 1.000 !important; -moz-opacity: 1 !important; filter: alpha(opacity=1) !important;"];
[self.container setAttribute:@"style" value:newSelfStyleString];
[(DOMElement *)[self.container parentNode] setAttribute:@"style" value:newParentStyleString];
}

return self;
Expand Down

0 comments on commit dde839f

Please sign in to comment.