Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
be55361a
Commit
be55361a
authored
Jun 06, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
increase/decrease editor font size
parent
7d5cfbb9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
app.js
src/app.js
+4
-1
editor.js
src/app/editor.js
+4
-0
file-panel.js
src/app/file-panel.js
+13
-0
No files found.
src/app.js
View file @
be55361a
...
...
@@ -196,7 +196,10 @@ var run = function () {
var
FilePanelAPI
=
{
createName
:
createNonClashingName
,
switchToFile
:
switchToFile
,
event
:
this
.
event
event
:
this
.
event
,
editorFontSize
:
function
(
incr
)
{
editor
.
editorFontSize
(
incr
)
}
}
var
filePanel
=
new
FilePanel
(
FilePanelAPI
,
files
)
// TODO this should happen inside file-panel.js
...
...
src/app/editor.js
View file @
be55361a
...
...
@@ -63,6 +63,10 @@ function Editor (editorElement) {
editor
.
session
.
setBreakpoint
(
row
,
css
)
}
this
.
editorFontSize
=
function
(
incr
)
{
editor
.
setFontSize
(
editor
.
getFontSize
()
+
incr
)
}
function
createSession
(
content
)
{
var
s
=
new
ace
.
EditSession
(
content
,
'ace/mode/javascript'
)
s
.
setUndoManager
(
new
ace
.
UndoManager
())
...
...
src/app/file-panel.js
View file @
be55361a
...
...
@@ -70,6 +70,13 @@ var css = csjs`
top : 0;
bottom : 0;
}
.changeeditorfontsize {
padding: 10px;
}
.changeeditorfontsize i {
display: block;
color: #111111;
}
`
var
limit
=
60
...
...
@@ -95,6 +102,10 @@ function filepanel (appAPI, files) {
</label>
</span>
`
:
''
}
<span class=
${
css
.
changeeditorfontsize
}
>
<i class="increditorsize fa fa-plus" aria-hidden="true" title="increase editor font size"></i>
<i class="decreditorsize fa fa-minus" aria-hidden="true" title="decrease editor font size"></i>
</span>
<span class=
${
css
.
toggleLHP
}
onclick=
${
toggle
}
title="Toggle left hand panel">
<i class="fa fa-angle-double-left"></i>
</span>
...
...
@@ -108,6 +119,8 @@ function filepanel (appAPI, files) {
var
events
=
new
EventManager
()
var
element
=
template
()
element
.
querySelector
(
'.increditorsize'
).
addEventListener
(
'click'
,
()
=>
{
appAPI
.
editorFontSize
(
1
)
})
element
.
querySelector
(
'.decreditorsize'
).
addEventListener
(
'click'
,
()
=>
{
appAPI
.
editorFontSize
(
-
1
)
})
// TODO please do not add custom javascript objects, which have no
// relation to the DOM to DOM nodes
element
.
events
=
events
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment