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
21f3c2c6
Commit
21f3c2c6
authored
Jan 11, 2017
by
chriseth
Committed by
GitHub
Jan 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #372 from ethereum/editor-size
Move storage.editorSize to app.js
parents
35b3a43b
0eee795e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
16 deletions
+9
-16
app.js
src/app.js
+9
-6
storage.js
src/app/storage.js
+0
-10
No files found.
src/app.js
View file @
21f3c2c6
...
@@ -335,6 +335,8 @@ var run = function () {
...
@@ -335,6 +335,8 @@ var run = function () {
// ----------------- resizeable ui ---------------
// ----------------- resizeable ui ---------------
var
EDITOR_SIZE_KEY
=
'editor-size-cache'
var
dragging
=
false
var
dragging
=
false
$
(
'#dragbar'
).
mousedown
(
function
(
e
)
{
$
(
'#dragbar'
).
mousedown
(
function
(
e
)
{
e
.
preventDefault
()
e
.
preventDefault
()
...
@@ -361,7 +363,7 @@ var run = function () {
...
@@ -361,7 +363,7 @@ var run = function () {
}
}
function
getEditorSize
()
{
function
getEditorSize
()
{
storage
.
setEditorSize
(
$
(
'#righthand-panel'
).
width
()
)
return
$
(
'#righthand-panel'
).
width
(
)
}
}
$
(
document
).
mouseup
(
function
(
e
)
{
$
(
document
).
mouseup
(
function
(
e
)
{
...
@@ -371,15 +373,16 @@ var run = function () {
...
@@ -371,15 +373,16 @@ var run = function () {
$
(
document
).
unbind
(
'mousemove'
)
$
(
document
).
unbind
(
'mousemove'
)
dragging
=
false
dragging
=
false
setEditorSize
(
delta
)
setEditorSize
(
delta
)
storage
.
set
EditorSize
(
delta
)
storage
.
set
(
EDITOR_SIZE_KEY
,
delta
)
reAdjust
()
reAdjust
()
}
}
})
})
// set cached defaults
if
(
storage
.
exists
(
EDITOR_SIZE_KEY
))
{
var
cachedSize
=
storage
.
getEditorSize
()
setEditorSize
(
storage
.
get
(
EDITOR_SIZE_KEY
))
if
(
cachedSize
)
setEditorSize
(
cachedSize
)
}
else
{
else
getEditorSize
()
storage
.
set
(
EDITOR_SIZE_KEY
,
getEditorSize
())
}
// ----------------- toggle right hand panel -----------------
// ----------------- toggle right hand panel -----------------
...
...
src/app/storage.js
View file @
21f3c2c6
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
var
utils
=
require
(
'./utils'
)
var
utils
=
require
(
'./utils'
)
function
Storage
(
updateFiles
)
{
function
Storage
(
updateFiles
)
{
var
EDITOR_SIZE_CACHE_KEY
=
'editor-size-cache'
this
.
rename
=
function
(
originalName
,
newName
)
{
this
.
rename
=
function
(
originalName
,
newName
)
{
var
content
=
this
.
get
(
originalName
)
var
content
=
this
.
get
(
originalName
)
this
.
set
(
newName
,
content
)
this
.
set
(
newName
,
content
)
...
@@ -16,14 +14,6 @@ function Storage (updateFiles) {
...
@@ -16,14 +14,6 @@ function Storage (updateFiles) {
window
.
localStorage
.
removeItem
(
name
)
window
.
localStorage
.
removeItem
(
name
)
}
}
this
.
setEditorSize
=
function
(
size
)
{
this
.
set
(
EDITOR_SIZE_CACHE_KEY
,
size
)
}
this
.
getEditorSize
=
function
()
{
return
this
.
get
(
EDITOR_SIZE_CACHE_KEY
)
}
this
.
getFileContent
=
function
(
key
)
{
this
.
getFileContent
=
function
(
key
)
{
return
this
.
get
(
utils
.
fileKey
(
key
))
return
this
.
get
(
utils
.
fileKey
(
key
))
}
}
...
...
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