Skip to content

show(): Fixed documentation #1015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

eironman
Copy link
Contributor

There was a contradiction between show() and css() documentation about !important behaviour

There was a contradiction between show() and css() documentation about !important behaviour
@jsf-clabot
Copy link

jsf-clabot commented Dec 21, 2016

CLA assistant check
All committers have signed the CLA.

@eironman eironman closed this Dec 27, 2016
@eironman eironman reopened this Dec 27, 2016
it is necessary to override the style using <code>.css( "display", "block !important")</code> should you wish for <code>.show()</code> to function correctly.</p>
<p>The matched elements will be revealed immediately, with no animation. This is roughly equivalent to calling <code>.css("display", "block")</code>, except that the <code>display</code> property is restored to whatever it was initially. If an element has a <code>display</code> value of <code>inline</code>, then is hidden and shown, it will once again be displayed <code>inline</code>.</p>
<p><strong>Note: </strong> If using !important in your styles, such as <code>display: none !important</code>, <code>.show()</code> will not override <code>!important</code>.
It is recommended to use different classes with <code>.addClass()</code>, <code>.removeClass()</code> or <code>.toggleClass()</code>. Another approach can be the use of <code>.attr("style","display:block !important")</code>, being careful not to overwrite the style attribute of the element.</p>
Copy link
Member

@AurelioDeRosa AurelioDeRosa Jan 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. The PR looks good. The only change required is to have the correct spacing here:

.attr("style","display:block !important")

It should be:

.css( "style", "display:block !important" )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AurelioDeRosa Your two code snippets differ not only in spacing. :-)

@AurelioDeRosa
Copy link
Member

lol

You're right. Wrong copy/paste.

There was a contradiction between show() and css() documentation about !important behaviour
Update documentation to fit the standards
@eironman
Copy link
Contributor Author

eironman commented Jan 3, 2017

Ok, I fixed it, but I did a mess updating the commit comments with amend. Now there are 5 commits for this small change. Is it fine or should I start again?

@AurelioDeRosa
Copy link
Member

No worries, I'll rebase anyway.

@mgol mgol closed this in 95dcca4 Mar 22, 2017
@mgol
Copy link
Member

mgol commented Mar 22, 2017

I tweaked the text a little: the final sentence was a little misleading as using .attr() will overwrite the style attribute.

Landed, thanks!

@eironman eironman deleted the eironman-patch-show branch March 22, 2017 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants