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
Enables y-scroll on textarea resize - Fixes issue 132 #142
Enables y-scroll on textarea resize - Fixes issue 132 #142
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'); | ||
} | ||
}); | ||
|
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.
extra line?
assets/js/util.js
Outdated
@@ -162,6 +164,11 @@ $(document).ready(function () { | |||
return false; | |||
}); | |||
|
|||
$('#originalText').mouseup(function () { | |||
if($('#originalText').height() < originalTextScrollHeight) { | |||
$('#originalText').css('overflow-y', 'scroll'); |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
@@ -162,6 +164,11 @@ $(document).ready(function () { | |||
return false; | |||
}); | |||
|
|||
$('#originalText').mouseup(function () { |
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.
Why the mouseup
event? Is there not a resize event?
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.
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
@@ -162,6 +164,11 @@ $(document).ready(function () { | |||
return false; | |||
}); | |||
|
|||
$('#originalText').mouseup(function () { | |||
if($('#originalText').height() < originalTextScrollHeight) { |
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.
Is it possible to check something like :overflow
?
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.
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
originalText
div using the resize drag handler, if the height of the div decreases as compared to the text contents,y-scroll
does not appear making it difficult for the user to view all the contents. This PR fixes it.