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
e2584414
Commit
e2584414
authored
Aug 20, 2019
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
let => const
parent
ad248553
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
panels-resize.js
src/lib/panels-resize.js
+5
-9
checkTerminalFilter.js
test-browser/commands/checkTerminalFilter.js
+1
-1
No files found.
src/lib/panels-resize.js
View file @
e2584414
...
@@ -23,18 +23,14 @@ const css = csjs`
...
@@ -23,18 +23,14 @@ const css = csjs`
export
default
class
PanelsResize
{
export
default
class
PanelsResize
{
constructor
(
panel
)
{
constructor
(
panel
)
{
this
.
panel
=
panel
this
.
panel
=
panel
let
self
=
this
const
string
=
panel
.
style
.
minWidth
const
string
=
panel
.
style
.
minWidth
this
.
minWidth
=
string
.
length
>
2
?
parseInt
(
string
.
substring
(
0
,
string
.
length
-
2
))
:
0
this
.
minWidth
=
string
.
length
>
2
?
parseInt
(
string
.
substring
(
0
,
string
.
length
-
2
))
:
0
window
.
addEventListener
(
'resize'
,
function
(
event
)
{
self
.
setPosition
(
event
)
})
}
}
render
()
{
render
()
{
this
.
ghostbar
=
yo
`<div class=
${
css
.
ghostbar
}
></div>`
this
.
ghostbar
=
yo
`<div class=
${
css
.
ghostbar
}
></div>`
le
t
mousedown
=
(
event
)
=>
{
cons
t
mousedown
=
(
event
)
=>
{
event
.
preventDefault
()
event
.
preventDefault
()
if
(
event
.
which
===
1
)
{
if
(
event
.
which
===
1
)
{
moveGhostbar
(
event
)
moveGhostbar
(
event
)
...
@@ -45,7 +41,7 @@ export default class PanelsResize {
...
@@ -45,7 +41,7 @@ export default class PanelsResize {
}
}
}
}
le
t
cancelGhostbar
=
(
event
)
=>
{
cons
t
cancelGhostbar
=
(
event
)
=>
{
if
(
event
.
keyCode
===
27
)
{
if
(
event
.
keyCode
===
27
)
{
document
.
body
.
removeChild
(
this
.
ghostbar
)
document
.
body
.
removeChild
(
this
.
ghostbar
)
document
.
removeEventListener
(
'mousemove'
,
moveGhostbar
)
document
.
removeEventListener
(
'mousemove'
,
moveGhostbar
)
...
@@ -54,11 +50,11 @@ export default class PanelsResize {
...
@@ -54,11 +50,11 @@ export default class PanelsResize {
}
}
}
}
le
t
moveGhostbar
=
(
event
)
=>
{
cons
t
moveGhostbar
=
(
event
)
=>
{
this
.
ghostbar
.
style
.
left
=
event
.
x
+
'px'
this
.
ghostbar
.
style
.
left
=
event
.
x
+
'px'
}
}
le
t
removeGhostbar
=
(
event
)
=>
{
cons
t
removeGhostbar
=
(
event
)
=>
{
document
.
body
.
removeChild
(
this
.
ghostbar
)
document
.
body
.
removeChild
(
this
.
ghostbar
)
document
.
removeEventListener
(
'mousemove'
,
moveGhostbar
)
document
.
removeEventListener
(
'mousemove'
,
moveGhostbar
)
document
.
removeEventListener
(
'mouseup'
,
removeGhostbar
)
document
.
removeEventListener
(
'mouseup'
,
removeGhostbar
)
...
@@ -74,7 +70,7 @@ export default class PanelsResize {
...
@@ -74,7 +70,7 @@ export default class PanelsResize {
}
}
setPosition
(
event
)
{
setPosition
(
event
)
{
le
t
panelWidth
=
this
.
calculatePanelWidth
(
event
)
cons
t
panelWidth
=
this
.
calculatePanelWidth
(
event
)
// close the panel if the width is less than a minWidth
// close the panel if the width is less than a minWidth
if
(
panelWidth
>
this
.
minWidth
-
10
||
this
.
panel
.
style
.
display
===
'none'
)
{
if
(
panelWidth
>
this
.
minWidth
-
10
||
this
.
panel
.
style
.
display
===
'none'
)
{
this
.
panel
.
style
.
width
=
panelWidth
+
'px'
this
.
panel
.
style
.
width
=
panelWidth
+
'px'
...
...
test-browser/commands/checkTerminalFilter.js
View file @
e2584414
...
@@ -17,7 +17,7 @@ function checkFilter (browser, filter, test, done) {
...
@@ -17,7 +17,7 @@ function checkFilter (browser, filter, test, done) {
done
()
done
()
return
return
}
}
var
filterClass
=
'#main-panel div[class^="search"] input[class^="filter"]'
const
filterClass
=
'#main-panel div[class^="search"] input[class^="filter"]'
browser
.
setValue
(
filterClass
,
filter
,
function
()
{
browser
.
setValue
(
filterClass
,
filter
,
function
()
{
browser
.
execute
(
function
()
{
browser
.
execute
(
function
()
{
return
document
.
querySelector
(
'#main-panel div[class^="journal"]'
).
innerHTML
===
test
return
document
.
querySelector
(
'#main-panel div[class^="journal"]'
).
innerHTML
===
test
...
...
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