Permalink
Browse files

the change in opacity is now *added* to the original styles instead o…

…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...
1 parent 9687059 commit dde839f6c7bc61a6ae8690c95ed4da2e2412a273 Simone Manganelli committed with Apr 21, 2009
Showing with 7 additions and 3 deletions.
  1. +7 −3 Plugin/Plugin.m
View
@@ -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;

0 comments on commit dde839f

Please sign in to comment.