From dde839f6c7bc61a6ae8690c95ed4da2e2412a273 Mon Sep 17 00:00:00 2001 From: Simone Manganelli Date: Wed, 22 Apr 2009 07:25:01 +0800 Subject: [PATCH] the change in opacity is now *added* to the original styles instead of replacing, so that positioning and other attributes won't get affected Signed-off-by: Jonathan 'Wolf' Rentzsch --- Plugin/Plugin.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Plugin/Plugin.m b/Plugin/Plugin.m index ab0018c3..c01db829 100644 --- a/Plugin/Plugin.m +++ b/Plugin/Plugin.m @@ -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;