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

Enables y-scroll on textarea resize - Fixes issue 132 #142

Conversation

share-with-me
Copy link
Contributor

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.

@sushain97
Copy link
Member

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.

@share-with-me
Copy link
Contributor Author

@sushain97 , The Travis build succeeds now :)

@share-with-me
Copy link
Contributor Author

Reviews on this @sushain97 ?!

$('#originalText').css('overflow-y', 'scroll');
}
});

Copy link
Member

Choose a reason for hiding this comment

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

extra line?

@@ -162,6 +164,11 @@ $(document).ready(function () {
return false;
});

$('#originalText').mouseup(function () {
if($('#originalText').height() < originalTextScrollHeight) {
$('#originalText').css('overflow-y', 'scroll');
Copy link
Member

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.

Copy link
Contributor Author

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 () {
Copy link
Member

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?

Copy link
Contributor Author

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!

@@ -162,6 +164,11 @@ $(document).ready(function () {
return false;
});

$('#originalText').mouseup(function () {
if($('#originalText').height() < originalTextScrollHeight) {
Copy link
Member

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?

Copy link
Contributor Author

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?

@share-with-me
Copy link
Contributor Author

share-with-me commented Jun 19, 2017

Damn! Did a git pull and rebase and it gave me this! When I do a git diff locally, it only shows the differences meant for this PR. I am not sure what is happening!

@sushain97
Copy link
Member

You shouldn't be doing a pull and rebase. You should be doing git pull --rebase.

@share-with-me
Copy link
Contributor Author

share-with-me commented Jun 19, 2017

Ohh, I will try it now! So I should rebase against the goavki/master directly right? so that all changes are pulled in my branch?

@share-with-me
Copy link
Contributor Author

I have the solution ready for issues #132 and #151 in another branch. Will be easier for me to create a new PR for issue 151 which will handle both :P. Can I go ahead with that? :P

@sushain97
Copy link
Member

Will be easier for me to create a new PR for issue 151 which will handle both :P. Can I go ahead with that? :P

Sure.

@share-with-me
Copy link
Contributor Author

Thanks :D .
Closing this and continuing it in #152

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

2 participants