Enables y-scroll on textarea resize - Fixes issue 132#142
Enables y-scroll on textarea resize - Fixes issue 132#142share-with-me wants to merge 24 commits intoapertium:masterfrom
Conversation
|
For some reason, Travis isn't importing things here. You can always view them at https://travis-ci.org/goavki/apertium-html-tools/pull_requests though. |
|
@sushain97 , The Travis build succeeds now :) |
|
Reviews on this @sushain97 ?! |
assets/js/util.js
Outdated
| $('#originalText').css('overflow-y', 'scroll'); | ||
| } | ||
| }); | ||
|
|
assets/js/util.js
Outdated
|
|
||
| $('#originalText').mouseup(function () { | ||
| if($('#originalText').height() < originalTextScrollHeight) { | ||
| $('#originalText').css('overflow-y', 'scroll'); |
There was a problem hiding this comment.
Why can't this situation be solved with simply a overflow: y-scroll? I'm guessing you've tried it.
There was a problem hiding this comment.
Why can't this situation be solved with simply a
overflow: y-scroll?
Um, I had tried that! As soon as synchronizeTextareaHeights method is called, the CSS for this div changes. And thus, I started with this approach of checking if the textarea height falls in the range for scrolling!
| return false; | ||
| }); | ||
|
|
||
| $('#originalText').mouseup(function () { |
There was a problem hiding this comment.
Why the mouseup event? Is there not a resize event?
There was a problem hiding this comment.
Is there not a resize event?
This stackoverflow link discusses about a resize event that we will need to code up to detect a change in textarea dimensions. This too, uses mouseup event only! Thus, I chose to go with the mouseup approach!
assets/js/util.js
Outdated
| }); | ||
|
|
||
| $('#originalText').mouseup(function () { | ||
| if($('#originalText').height() < originalTextScrollHeight) { |
There was a problem hiding this comment.
Is it possible to check something like :overflow?
There was a problem hiding this comment.
Um, :overflow to check if the element is having the overflow?
|
Damn! Did a |
|
You shouldn't be doing a pull and rebase. You should be doing |
|
Ohh, I will try it now! So I should |
Sure. |
|
Thanks :D . |
This PR fixes issue #132 .
As discussed on the issue thread, currently, on resizing the
originalTextdiv using the resize drag handler, if the height of the div decreases as compared to the text contents,y-scrolldoes not appear making it difficult for the user to view all the contents. This PR fixes it.