-
Notifications
You must be signed in to change notification settings - Fork 94
Enables y-scroll on textarea resize - Fixes issue 132 #142
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
Changes from 1 commit
4dda831
7774619
c380f5f
92b0716
f8a476d
7e8f863
09860df
f9f50fb
d96550f
7dc9a8e
3b7eef3
e175aff
b87953b
3d5b9f6
934a87c
501aabf
eea5402
0e4886f
ffbfd64
3fab983
aa7cce9
7d470a4
3a024cb
7c56308
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,8 @@ var TEXTAREA_AUTO_RESIZE_MINIMUM_WIDTH = 768, | |
| BACK_TO_TOP_BUTTON_ACTIVATION_HEIGHT = 300, | ||
| THRESHOLD_REQUEST_URL_LENGTH = 2000; // maintain 48 characters buffer for generated parameters | ||
|
|
||
| var originalTextScrollHeight; | ||
|
|
||
| // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill | ||
| /* eslint-disable */ | ||
| if (typeof Object.assign != 'function') { | ||
|
|
@@ -162,6 +164,12 @@ $(document).ready(function () { | |
| return false; | ||
| }); | ||
|
|
||
| $('#originalText').mouseup( function() { | ||
| if($('#originalText').height() < originalTextScrollHeight) { | ||
| $('#originalText').css('overflow-y', 'scroll'); | ||
|
||
| } | ||
| }); | ||
|
|
||
|
||
| }); | ||
|
|
||
| if(config.PIWIK_SITEID && config.PIWIK_URL) { | ||
|
|
@@ -278,7 +286,7 @@ function synchronizeTextareaHeights() { | |
| 'overflow-y': 'hidden', | ||
| 'height': 'auto' | ||
| }); | ||
| var originalTextScrollHeight = $('#originalText')[0].scrollHeight; | ||
| originalTextScrollHeight = $('#originalText')[0].scrollHeight; | ||
| $('#originalText').css('height', originalTextScrollHeight + 'px'); | ||
| $('#translatedText').css('height', originalTextScrollHeight + 'px'); | ||
| } | ||
|
|
||
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,
:overflowto check if the element is having theoverflow?