Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CodeMirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Moritz Aurel Pascal Schubotz
CodeMirror
Commits
cf135033
Commit
cf135033
authored
12 years ago
by
Marijn Haverbeke
Browse files
Options
Downloads
Patches
Plain Diff
Mention new resizing model in manual
parent
5b9249f3
Loading
Loading
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/manual.html
+24
-14
24 additions, 14 deletions
doc/manual.html
with
24 additions
and
14 deletions
doc/manual.html
+
24
−
14
View file @
cf135033
...
...
@@ -391,16 +391,17 @@
<dl>
<dt
id=
"class_CodeMirror"
><code>
CodeMirror
</code></dt>
<dd>
The outer element of the editor. This should be used for
borders and positioning. Can also be used to set
styles that
should hold for everything inside the editor (such
as font
and font size), or to set a background.
</dd>
<dd>
The outer element of the editor. This should be used for
the
editor width,
borders and positioning. Can also be used to set
styles that
should hold for everything inside the editor (such
as font
and font size), or to set a background.
</dd>
<dt
id=
"class_CodeMirror_scroll"
><code>
CodeMirror-scroll
</code></dt>
<dd>
This determines whether the editor scrolls (
<code>
overflow:
auto
</code>
+ fixed height). By default, it does. Giving
this
<code>
height: auto; overflow: visible;
</code>
will cause
the editor to resize to fit its content.
</dd>
<dd>
This determines the editor's height, and whether the editor
scrolls (
<code>
overflow: auto
</code>
+ fixed height). By
default, it does. Giving this
<code>
height: auto; overflow:
visible;
</code>
will cause the editor to resize to fit its
content.
</dd>
<dt
id=
"class_CodeMirror_focused"
><code>
CodeMirror-focused
</code></dt>
<dd>
Whenever the editor is focused, the top element gets this
...
...
@@ -440,6 +441,13 @@
<dd>
These are used to style matched (or unmatched) brackets.
</dd>
</dl>
<p>
So note carefully that, in order to resize the editor, you
should set a
<code>
width
</code>
on
the
<a
href=
"#getWrapperElement"
>
wrapper
</a>
(class
<code>
CodeMirror
</code>
) element, and a height on
the
<a
href=
"#getScrollerElement"
>
scroller
</a>
(class
<code>
CodeMirror-scroll
</code>
) element.
</p>
<p>
The actual lines, as well as the cursor, are represented
by
<code>
pre
</code>
elements. By default no text styling (such as
bold) that might change line height is applied. If you do want
...
...
@@ -713,13 +721,15 @@
<dt
id=
"getInputField"
><code>
getInputField() → textarea
</code></dt>
<dd>
Returns the hidden textarea used to read input.
</dd>
<dt
id=
"getWrapperElement"
><code>
getWrapperElement() → node
</code></dt>
<dd>
Returns the DOM node that represents the editor. Remove this
from your tree to delete an editor instance.
</dd>
<dd>
Returns the DOM node that represents the editor, and
controls its width. Remove this from your tree to delete an
editor instance. Set it's
<code>
width
</code>
style when
resizing.
</dd>
<dt
id=
"getScrollerElement"
><code>
getScrollerElement() → node
</code></dt>
<dd>
Returns the DOM node that is responsible for the
sizing and
the
scrolling of the editor. You can change
the
<code>
height
</code>
and
<code>
width
</code>
style
s
of this
element to resize an
editor. (You might have to call
<dd>
Returns the DOM node that is responsible for the
vertical
sizing and horizontal
scrolling of the editor. You can change
the
<code>
height
</code>
style of this
element to resize an
editor. (You might have to call
the
<a
href=
"#refresh"
><code>
refresh
</code></a>
method
afterwards.)
</dd>
<dt
id=
"getGutterElement"
><code>
getGutterElement() → node
</code></dt>
...
...
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