Skip to content

Commit dde839f

Browse files
Simone Manganellirentzsch
Simone Manganelli
authored andcommitted
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 <[email protected]>
1 parent 9687059 commit dde839f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Plugin/Plugin.m

+7-3
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,14 @@ - (id) initWithArguments:(NSDictionary *)arguments
237237
[originalOpacityDict setObject:[self.container getAttribute:@"style"] forKey:@"self-style"];
238238
[originalOpacityDict setObject:[(DOMElement *)[self.container parentNode] getAttribute:@"style"] forKey:@"parent-style"];
239239
self.originalOpacityAttributes = originalOpacityDict;
240-
240+
241+
NSString *opacityResetString = @"; opacity: 1.000 !important; -moz-opacity: 1 !important; filter: alpha(opacity=1) !important;";
242+
NSString *newSelfStyleString = [[self.originalOpacityAttributes objectForKey:@"self-style"] stringByAppendingString:opacityResetString];
243+
NSString *newParentStyleString = [[self.originalOpacityAttributes objectForKey:@"parent-style"] stringByAppendingString:opacityResetString];
244+
241245
[self.container setAttribute:@"wmode" value:@"opaque"];
242-
[self.container setAttribute:@"style" value:@"opacity: 1.000 !important; -moz-opacity: 1 !important; filter: alpha(opacity=1) !important;"];
243-
[(DOMElement *)[self.container parentNode] setAttribute:@"style" value:@"opacity: 1.000 !important; -moz-opacity: 1 !important; filter: alpha(opacity=1) !important;"];
246+
[self.container setAttribute:@"style" value:newSelfStyleString];
247+
[(DOMElement *)[self.container parentNode] setAttribute:@"style" value:newParentStyleString];
244248
}
245249

246250
return self;

0 commit comments

Comments
 (0)