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
affd7199
Commit
affd7199
authored
May 22, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix autocomplete
parent
8eaab4fc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
28 deletions
+21
-28
terminal.js
src/app/panels/terminal.js
+2
-2
auto-complete-popup.js
src/app/ui/auto-complete-popup.js
+16
-26
auto-complete-popup-styles.js
src/app/ui/styles/auto-complete-popup-styles.js
+3
-0
No files found.
src/app/panels/terminal.js
View file @
affd7199
...
...
@@ -168,8 +168,8 @@ class Terminal extends BaseApi {
`
self
.
_view
.
term
=
yo
`
<div class="
${
css
.
terminal_container
}
" onscroll=
${
throttle
(
reattach
,
10
)}
onclick=
${
focusinput
}
>
<div style="
background-color: grey;
${
self
.
_components
.
autoCompletePopup
.
render
()}
<div class="bg-secondary" style="
position: absolute;
height: 100%;
width: 100%;
...
...
src/app/ui/auto-complete-popup.js
View file @
affd7199
...
...
@@ -3,8 +3,6 @@ var remixLib = require('remix-lib')
var
EventManager
=
remixLib
.
EventManager
var
Commands
=
require
(
'../constants/commands'
)
var
modal
=
require
(
'./modaldialog.js'
)
// -------------- styling ----------------------
var
css
=
require
(
'./styles/auto-complete-popup-styles'
)
...
...
@@ -27,26 +25,23 @@ class AutoCompletePopup {
self
.
data
=
{
_options
:
[]
}
self
.
_components
=
{
modal
:
null
}
self
.
_view
=
{}
self
.
_components
=
{}
self
.
_view
self
.
_startingElement
=
0
self
.
_elementsToShow
=
4
self
.
_selectedElement
=
0
this
.
extraCommands
=
[]
this
.
render
()
this
.
extendAutocompletion
()
}
render
()
{
var
self
=
this
self
.
_view
.
autoComplete
=
yo
`
<div class="
${
css
.
popup
}
">
let
autoComplete
=
yo
`
<div class="
${
css
.
popup
}
alert alert-secondary
">
<div>
${
self
.
data
.
_options
.
map
((
item
,
index
)
=>
{
return
yo
`
<div class="
${
css
.
autoCompleteItem
}
${
css
.
listHandlerHide
}
item
${
self
.
_selectedElement
===
index
?
'b
g-second
ary'
:
''
}
">
<div class="
${
css
.
autoCompleteItem
}
${
css
.
listHandlerHide
}
item
${
self
.
_selectedElement
===
index
?
'b
order border-prim
ary'
:
''
}
">
<div value=
${
index
}
onclick=
${(
event
)
=>
{
self
.
handleSelect
(
event
.
srcElement
.
innerText
)
}}
>
$
{
getKeyOf
(
item
)}
</div>
...
...
@@ -62,22 +57,19 @@ class AutoCompletePopup {
</div>
</div>
`
function
setUpPopUp
()
{
handleOpenPopup
()
handleListSize
()
function
setUpPopUp
(
autoComplete
)
{
handleOpenPopup
(
autoComplete
)
handleListSize
(
autoComplete
)
}
function
handleOpenPopup
()
{
if
(
self
.
data
.
_options
.
length
>
0
)
{
self
.
_view
.
autoComplete
.
style
.
display
=
'block'
self
.
_components
.
modal
=
modal
(
''
,
self
.
_view
.
autoComplete
,
{
label
:
null
},
{
label
:
null
},
null
,
{
class
:
css
.
modalContent
,
hideClose
:
true
})
}
function
handleOpenPopup
(
autoComplete
)
{
autoComplete
.
style
.
display
=
self
.
data
.
_options
.
length
>
0
?
'block'
:
'none'
}
function
handleListSize
()
{
function
handleListSize
(
autoComplete
)
{
if
(
self
.
data
.
_options
.
length
>=
self
.
_startingElement
)
{
for
(
let
i
=
self
.
_startingElement
;
i
<
(
self
.
_elementsToShow
+
self
.
_startingElement
);
i
++
)
{
let
el
=
self
.
_view
.
autoComplete
.
querySelectorAll
(
'.item'
)[
i
]
let
el
=
autoComplete
.
querySelectorAll
(
'.item'
)[
i
]
if
(
el
)
{
el
.
classList
.
remove
(
css
.
listHandlerHide
)
el
.
classList
.
add
(
css
.
listHandlerShow
)
...
...
@@ -85,10 +77,9 @@ class AutoCompletePopup {
}
}
}
setUpPopUp
()
return
self
.
_view
setUpPopUp
(
autoComplete
)
if
(
!
this
.
_view
)
this
.
_view
=
autoComplete
return
autoComplete
}
handleSelect
(
text
)
{
...
...
@@ -189,8 +180,7 @@ class AutoCompletePopup {
removeAutoComplete
()
{
if
(
!
this
.
isOpen
)
return
this
.
_view
.
autoComplete
.
style
.
display
=
'none'
if
(
this
.
_components
.
modal
)
this
.
_components
.
modal
.
cancelListener
()
this
.
_view
.
style
.
display
=
'none'
this
.
isOpen
=
false
this
.
data
.
_options
=
[]
this
.
_startingElement
=
0
...
...
src/app/ui/styles/auto-complete-popup-styles.js
View file @
affd7199
...
...
@@ -2,6 +2,7 @@ var csjs = require('csjs-inject')
var
css
=
csjs
`
.popup {
position : absolute;
text-align : left;
display : none;
width : 100%;
...
...
@@ -9,6 +10,8 @@ var css = csjs`
font-size : 10px;
overflow : auto;
padding-bottom : 13px;
z-index : 2;
bottom : 1.7em;
}
.autoCompleteItem {
...
...
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