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

Increase the height of the code boxes, make textarea vertically resizable #1

Open
wants to merge 6 commits into
base: gh-pages
Choose a base branch
from

Conversation

kirjs
Copy link

@kirjs kirjs commented Apr 19, 2014

See the screenshot below

screen shot 2014-04-19 at 1 28 31 pm

@treyhunner
Copy link
Member

@kcherkashin thanks for the pull request. The textareas are supposed to resize automatically as they do in Chrome. I just noticed that this behavior is broken in Firefox. I'd like to reproduce the expected behavior instead of introduce new behavior.

Also note that the style.scss file is unminified/preprocessed so I couldn't view your version at http://kcherkashin.github.io/live-demo/ and we'd need to run "grunt build" to produce the compressed to be committed for the actual site (which is hosted on Github pages).

@kirjs
Copy link
Author

kirjs commented Apr 19, 2014

Trey, thanks for the reply, I updated the css, so you can see the result at: http://kcherkashin.github.io/live-demo/

Currently the textarea is not being resized for me in any browser: debugger says the code is trying to use forEach on a NodeList, which shouldn't work anywhere.

It should be an easy fix, let me take a quick look at it.

@kirjs
Copy link
Author

kirjs commented Apr 19, 2014

Trey,

I'm looking at vquery.js file, it has a toArray function, which is never used anywhere.
I would expect that wrapping $.getByTag in it, or introducing something like $.getArrayByTag would be the cleanest way to fix the code.
What do you think?

@treyhunner
Copy link
Member

I believe the line NodeList.prototype.forEach = Array.prototype.forEach; in vquery.js should fix that problem.

I'm surprised it doesn't work for you in Chrome because it works fine for me. Here's what it does:

selection_174

selection_175

@kirjs
Copy link
Author

kirjs commented Apr 19, 2014

This sounds like a really interesting bug, I wonder if one of the browser plugins extends NodeList prototype in your browser.

screen shot 2014-04-19 at 6 13 33 pm

NodeList.prototype.forEach = Array.prototype.forEach sounds live a valid solution, unless vquery.js is going to be used outside of the app.

@kirjs
Copy link
Author

kirjs commented Apr 19, 2014

Hm, looks like it's my chrome which is special, which version do you have?
http://www.browserstack.com/screenshots/aa3e38c2ed70bb52537b2069d80bf9d667df6d27

@treyhunner
Copy link
Member

33.0.1750.152 (Developer Build 256984) Ubuntu 13.10

@kirjs
Copy link
Author

kirjs commented Apr 19, 2014

Just realized that in Chrome HTMLCollection is returned. The fix should look like this:

NodeList.prototype.forEach = Array.prototype.forEach;
HTMLCollection.prototype.forEach = Array.prototype.forEach;

@kirjs
Copy link
Author

kirjs commented Apr 20, 2014

Trey,

I added the prototype hack to make forEach work,
disabled textarea resizing,
left some sensible default height for textarea (200px), which will be overridden if JS works.

http://kcherkashin.github.io/live-demo/

What do you think?

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.

2 participants