Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dialog: Remove width, min-height, height styles on destroy. Fixes #81…
…19 - Dialog: Destroying a dialog leaves some styles changed.
- Loading branch information
1 parent
975bde5
commit 3c2acc3
Showing
3 changed files
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this destroy any (inline) styles they had prior to be dialoged? The ticket contains a fiddle showing the problem: http://jsfiddle.net/aZ3CB/3/
3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but what is the use case that you're working with?
3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An element that is a sidebar but when the window gets too small pops out into a dialog.
3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess our two options if we want to actually restore those are either saving the three properties individually or just saving
style.cssText
. @mikesherov thoughts?3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style.cssText gets the inline styles. You'd want getComputedStyle().cssText, however, that'll add a whole bunch of inline styles. So, saving the 3 properties is the way to go.
3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought was that we only care about inline styles in this case, because that's what we're changing. But I agree that handling the 3 specific properties is better.
3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenic Unfortunately there's no good way for us to restore the values, since we can't tell the difference between an explicit height and auto height. Clearing the inline styles seems like the best solution, unless you have another proposal.
3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scottgonzalez can't take the time to prototype now, but I'm pretty sure there's a way to get the currently-applied inline styles for an element. Then you could save the ones that are there before you guys overwrite them, and restore them after the dialog is destroyed. We are doing something similar in our app as a workaround.
3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenic I have an idea for this. I'll test it out now.
3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenic Check out f59f5a8, this should address your issues.
3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this breaks accordion tests in IE7: http://swarm.jquery.org/result/636370
Expects
overflow: "visible"
, but actual is "scroll".3c2acc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I know. That's why it was commented out the first time. We haven't tracked down the cause of the failure yet, but it seems to be a bug in IE7.