Skip to content
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

JS output area misaligned #4105

Merged
merged 0 commits into from Sep 18, 2013
Merged

JS output area misaligned #4105

merged 0 commits into from Sep 18, 2013

Conversation

Zsailer
Copy link
Member

@Zsailer Zsailer commented Aug 24, 2013

I think this is a bug. Anytime you use .show() on the container object in a JS cell to display an element (dynamically from JQuery), the <div class='output_area'>'s display attribute becomes block. Apparently, .show() does this as a default setting. This causes the output area and element to line up incorrectly, underneath the hovering out_prompt_overlay button. In this case where I have a checkbox, I can't click/check the box because this button is in the way.

See this example:

screen shot 2013-08-23 at 11 18 36 pm

I just added a simple CSS attribute to override this default and prevent the output_area from inheriting display setting and this weird behavior.

screen shot 2013-08-23 at 11 14 30 pm

I'm not sure this is the best way to go about it... but it works.

@minrk
Copy link
Member

minrk commented Aug 24, 2013

We shouldn't be writing CSS explicitly in the javascript, we should be applying the proper classes.

@ghost ghost assigned Zsailer Sep 12, 2013
@minrk
Copy link
Member

minrk commented Sep 18, 2013

@Zsailer any plans to update this?

@Zsailer
Copy link
Member Author

Zsailer commented Sep 18, 2013

Yes, I had forgotten about this. I'll work on this today and ping you later to review.

@minrk minrk merged commit 9fde9a8 into ipython:master Sep 18, 2013
@minrk
Copy link
Member

minrk commented Sep 18, 2013

Just to note - I did not merge this PR, it was automatically closed when GitHub noticed there were zero differences between master and Zach's branch. It will be opened anew with a second fix.

@payne92
Copy link
Contributor

payne92 commented Nov 23, 2013

A workaround for this problem: instead of container.show() to make the output container displayed, remove the style attribute that's making it hidden:

container.removeAttr("style");

A better approach (feature request): the iPython Javascript environment provides a (trivial) method to "show the output area container". This isolates/abstracts Javascript cell output from surrounding CSS detail.

Can this issue be reopened, or should I start a new feature request issue?

@ellisonbg
Copy link
Member

Here is a fix for this issue: PR #4646

It was much more complicated that we thought and led to some more substantial refactoring of the output logic.

ellisonbg added a commit to ellisonbg/ipython that referenced this pull request Dec 7, 2013
This was inspired by PR ipython#4105.

* JavaScript output no longer requires calling container.show()
* Added output_javascript CSS class that has zero height when
  empty.
* JavaScript error messages are properly indented with the prompt
  area.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
This was inspired by PR ipython#4105.

* JavaScript output no longer requires calling container.show()
* Added output_javascript CSS class that has zero height when
  empty.
* JavaScript error messages are properly indented with the prompt
  area.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants