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
d91467b9
Commit
d91467b9
authored
Feb 15, 2017
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sync file on tab switch
parent
e064f0d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
app.js
src/app.js
+8
-4
No files found.
src/app.js
View file @
d91467b9
...
...
@@ -299,6 +299,8 @@ var run = function () {
editor
.
event
.
register
(
'sessionSwitched'
,
updateFiles
)
function
switchToFile
(
file
)
{
editorSyncFile
()
currentFile
=
file
if
(
files
.
isReadOnly
(
file
))
{
...
...
@@ -659,6 +661,11 @@ var run = function () {
compiler
.
compile
(
files
,
target
)
}
function
editorSyncFile
()
{
var
input
=
editor
.
get
(
currentFile
)
files
.
set
(
currentFile
,
input
)
}
var
previousInput
=
''
var
compileTimeout
=
null
var
saveTimeout
=
null
...
...
@@ -677,10 +684,7 @@ var run = function () {
if
(
saveTimeout
)
{
window
.
clearTimeout
(
saveTimeout
)
}
saveTimeout
=
window
.
setTimeout
(
function
()
{
var
input
=
editor
.
get
(
currentFile
)
files
.
set
(
currentFile
,
input
)
},
5000
)
saveTimeout
=
window
.
setTimeout
(
editorSyncFile
,
5000
)
// special case: there's nothing else to do
if
(
input
===
''
)
{
...
...
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