Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
proto3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
protokollsystem
proto3
Commits
80d530d6
Commit
80d530d6
authored
7 years ago
by
Robin Sonnabend
Browse files
Options
Downloads
Patches
Plain Diff
Do not resize textareas resized by the user
/close
#118
parent
c5138054
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
static/js/script.js
+17
-3
17 additions, 3 deletions
static/js/script.js
with
17 additions
and
3 deletions
static/js/script.js
+
17
−
3
View file @
80d530d6
...
...
@@ -9,6 +9,9 @@ function toggle_expansion() {
var
max_height
=
400
;
function
resize_textarea
(
textarea
)
{
function
_inner_resize_textarea
()
{
var
current_height
=
textarea
.
style
.
height
;
var
current_width
=
textarea
.
style
.
width
;
var
use_current_height
=
(
current_height
!=
""
)
&&
Boolean
(
textarea
.
custom_height
);
textarea
.
style
.
height
=
"
auto
"
;
var
new_height
=
textarea
.
scrollHeight
;
var
overflow
=
"
hidden
"
;
...
...
@@ -16,8 +19,20 @@ function resize_textarea(textarea) {
new_height
=
max_height
;
overflow
=
"
visible
"
;
}
var
keep_height
=
false
;
if
(
use_current_height
)
{
current_height
=
parseInt
(
current_height
);
if
(
current_height
>
new_height
&&
current_height
!=
textarea
.
custom_height
)
{
keep_height
=
true
;
}
}
if
(
!
keep_height
)
{
textarea
.
style
.
height
=
new_height
+
"
px
"
;
textarea
.
custom_height
=
new_height
;
textarea
.
style
.
overflow
=
overflow
;
}
else
{
textarea
.
style
.
height
=
current_height
+
"
px
"
;
}
}
return
_inner_resize_textarea
}
...
...
@@ -30,7 +45,6 @@ function resize_textarea_delayed(textarea) {
function
tab_on_key_down
(
textarea
)
{
function
_inner_tab_on_key_down
(
e
)
{
console
.
log
(
e
);
if
(
e
.
keyCode
==
9
)
{
var
start
=
textarea
.
selectionStart
;
var
end
=
textarea
.
selectionEnd
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment