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
2508db6e
Commit
2508db6e
authored
Jan 16, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resizing window
parent
d0a2e47c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
app.js
src/app.js
+2
-4
swap-panel-component.js
src/app/components/swap-panel-component.js
+2
-3
panels-resize.js
src/lib/panels-resize.js
+21
-4
No files found.
src/app.js
View file @
2508db6e
...
@@ -87,7 +87,6 @@ var css = csjs`
...
@@ -87,7 +87,6 @@ var css = csjs`
top : 0;
top : 0;
bottom : 0;
bottom : 0;
overflow : hidden;
overflow : hidden;
width : 82%;
}
}
.iconpanel {
.iconpanel {
background-color :
${
styles
.
leftPanel
.
backgroundColor_Panel
}
;
background-color :
${
styles
.
leftPanel
.
backgroundColor_Panel
}
;
...
@@ -106,8 +105,7 @@ var css = csjs`
...
@@ -106,8 +105,7 @@ var css = csjs`
position : absolute;
position : absolute;
top : 0;
top : 0;
bottom : 0;
bottom : 0;
overflow : hidden;
overflow : hidden
width : 16%;
}
}
.highlightcode {
.highlightcode {
position:absolute;
position:absolute;
...
@@ -191,7 +189,7 @@ class App {
...
@@ -191,7 +189,7 @@ class App {
self
.
_view
.
swappanel
.
style
.
left
=
self
.
_view
.
iconpanel
.
clientWidth
+
'px'
self
.
_view
.
swappanel
.
style
.
left
=
self
.
_view
.
iconpanel
.
clientWidth
+
'px'
self
.
_view
.
mainpanel
.
style
.
left
=
(
self
.
_view
.
iconpanel
.
clientWidth
+
self
.
_view
.
swappanel
.
clientWidth
)
+
'px'
self
.
_view
.
mainpanel
.
style
.
left
=
(
self
.
_view
.
iconpanel
.
clientWidth
+
self
.
_view
.
swappanel
.
clientWidth
)
+
'px'
let
resizeFeature
=
new
PanelsResize
(
'#swap-panel'
,
'#editor-container'
,
{
'minWidth'
:
30
0
})
// eslint-disable-line
let
resizeFeature
=
new
PanelsResize
(
'#swap-panel'
,
'#editor-container'
,
{
'minWidth'
:
400
,
x
:
45
0
})
// eslint-disable-line
run
.
apply
(
self
)
run
.
apply
(
self
)
}
}
...
...
src/app/components/swap-panel-component.js
View file @
2508db6e
...
@@ -50,14 +50,13 @@ module.exports = SwapPanelComponent
...
@@ -50,14 +50,13 @@ module.exports = SwapPanelComponent
const
css
=
csjs
`
const
css
=
csjs
`
.plugins {
.plugins {
height: : 100%;
height: : 100%;
overflow-y: auto;
overflow-y : auto;
margin-right: 10px;
}
}
.plugItIn {
.plugItIn {
display : none;
display : none;
height : 100%;
height : 100%;
}
}
.plugItIn.active {
.plugItIn.active {
display :block;
display :
block;
}
}
`
`
src/lib/panels-resize.js
View file @
2508db6e
...
@@ -26,6 +26,13 @@ const css = csjs`
...
@@ -26,6 +26,13 @@ const css = csjs`
}
}
`
`
/*
* opt:
* minWidth : minimn width for panels
* x : position of gutter at load
*
*
*/
export
default
class
PanelsResize
{
export
default
class
PanelsResize
{
constructor
(
idpanel1
,
idpanel2
,
opt
)
{
constructor
(
idpanel1
,
idpanel2
,
opt
)
{
var
panel1
=
document
.
querySelector
(
idpanel1
)
var
panel1
=
document
.
querySelector
(
idpanel1
)
...
@@ -59,15 +66,19 @@ export default class PanelsResize {
...
@@ -59,15 +66,19 @@ export default class PanelsResize {
ghostbar
.
style
.
left
=
event
.
x
+
'px'
ghostbar
.
style
.
left
=
event
.
x
+
'px'
}
}
let
setPosition
=
(
event
)
=>
{
let
p
=
processPositiions
(
event
)
panel1
.
style
.
width
=
p
.
panel1Width
+
'px'
panel2
.
style
.
left
=
p
.
panel2left
+
'px'
panel2
.
style
.
width
=
p
.
panel2Width
+
'px'
}
let
removeGhostbar
=
(
event
)
=>
{
let
removeGhostbar
=
(
event
)
=>
{
document
.
body
.
removeChild
(
ghostbar
)
document
.
body
.
removeChild
(
ghostbar
)
document
.
removeEventListener
(
'mousemove'
,
moveGhostbar
)
document
.
removeEventListener
(
'mousemove'
,
moveGhostbar
)
document
.
removeEventListener
(
'mouseup'
,
removeGhostbar
)
document
.
removeEventListener
(
'mouseup'
,
removeGhostbar
)
document
.
removeEventListener
(
'keydown'
,
cancelGhostbar
)
document
.
removeEventListener
(
'keydown'
,
cancelGhostbar
)
let
p
=
processPositiions
(
event
)
setPosition
(
event
)
panel1
.
style
.
width
=
p
.
panel1Width
+
'px'
panel2
.
style
.
left
=
p
.
panel2left
+
'px'
panel2
.
style
.
width
=
p
.
panel2Width
+
'px'
}
}
let
processPositiions
=
(
event
)
=>
{
let
processPositiions
=
(
event
)
=>
{
...
@@ -79,7 +90,13 @@ export default class PanelsResize {
...
@@ -79,7 +90,13 @@ export default class PanelsResize {
return
{
panel1Width
,
panel2left
,
panel2Width
}
return
{
panel1Width
,
panel2left
,
panel2Width
}
}
}
window
.
addEventListener
(
'resize'
,
function
(
event
){
setPosition
({
x
:
panel1
.
offsetLeft
+
panel1
.
clientWidth
})
})
var
dragbar
=
yo
`<div onmousedown=
${
mousedown
}
class=
${
css
.
dragbar
}
></div>`
var
dragbar
=
yo
`<div onmousedown=
${
mousedown
}
class=
${
css
.
dragbar
}
></div>`
panel1
.
appendChild
(
dragbar
)
panel1
.
appendChild
(
dragbar
)
setPosition
(
opt
)
}
}
}
}
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