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
bdb5a09f
Commit
bdb5a09f
authored
Sep 07, 2015
by
d11e9
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cache editor resizing and use as default
parent
3ff5f355
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
17 deletions
+26
-17
index.html
index.html
+26
-17
No files found.
index.html
View file @
bdb5a09f
...
@@ -258,39 +258,48 @@ input[readonly] {
...
@@ -258,39 +258,48 @@ input[readonly] {
// ----------------- resizeable ui ---------------
// ----------------- resizeable ui ---------------
var
EDITOR_SIZE_CACHE_KEY
=
"editor-size-cache"
;
var
dragging
=
false
;
var
dragging
=
false
;
$
(
'#dragbar'
).
mousedown
(
function
(
e
){
$
(
'#dragbar'
).
mousedown
(
function
(
e
){
e
.
preventDefault
();
e
.
preventDefault
();
dragging
=
true
;
dragging
=
true
;
var
main
=
$
(
'#righthand-panel'
);
var
main
=
$
(
'#righthand-panel'
);
var
ghostbar
=
$
(
'<div id="ghostbar">'
,
{
var
ghostbar
=
$
(
'<div id="ghostbar">'
,
{
css
:
{
css
:
{
top
:
main
.
offset
().
top
,
top
:
main
.
offset
().
top
,
left
:
main
.
offset
().
left
left
:
main
.
offset
().
left
}
}
}).
prependTo
(
'body'
);
}).
prependTo
(
'body'
);
$
(
document
).
mousemove
(
function
(
e
){
$
(
document
).
mousemove
(
function
(
e
){
ghostbar
.
css
(
"left"
,
e
.
pageX
+
2
);
ghostbar
.
css
(
"left"
,
e
.
pageX
+
2
);
});
});
});
});
var
$body
=
$
(
'body'
);
var
$body
=
$
(
'body'
);
function
setEditorSize
(
delta
)
{
$
(
'#righthand-panel'
).
css
(
"width"
,
delta
);
$
(
'#editor'
).
css
(
"right"
,
delta
);
}
$
(
document
).
mouseup
(
function
(
e
){
$
(
document
).
mouseup
(
function
(
e
){
if
(
dragging
)
{
if
(
dragging
)
{
var
delta
=
$body
.
width
()
-
e
.
pageX
+
2
;
var
delta
=
$body
.
width
()
-
e
.
pageX
+
2
;
$
(
'#righthand-panel'
).
css
(
"width"
,
delta
);
setEditorSize
(
delta
)
$
(
'#editor'
).
css
(
"right"
,
delta
);
$
(
'#ghostbar'
).
remove
(
);
$
(
'#ghostbar'
).
remove
(
);
$
(
document
).
unbind
(
'mousemove'
);
$
(
document
).
unbind
(
'mousemove'
)
;
dragging
=
false
;
dragging
=
false
;
window
.
localStorage
.
setItem
(
EDITOR_SIZE_CACHE_KEY
,
delta
)
;
onResize
();
onResize
();
}
}
});
});
// set cached defaults
var
cachedSize
=
window
.
localStorage
.
getItem
(
EDITOR_SIZE_CACHE_KEY
);
if
(
cachedSize
)
{
setEditorSize
(
cachedSize
)
}
// ----------------- editor ----------------------
// ----------------- editor ----------------------
...
...
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