Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
V
VISPA web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
84
Issues
84
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3pia
VISPA
VISPA web
Commits
e7c513f5
Commit
e7c513f5
authored
Feb 10, 2020
by
Benjamin Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extension/file2: added suggestions for current directory items in navbar
parent
5f5d1f8e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
0 deletions
+28
-0
vispa/extensions/file2/static/html/vue/browser.html
vispa/extensions/file2/static/html/vue/browser.html
+2
-0
vispa/extensions/file2/static/html/vue/navbar.html
vispa/extensions/file2/static/html/vue/navbar.html
+4
-0
vispa/extensions/file2/static/js/vue/browser.js
vispa/extensions/file2/static/js/vue/browser.js
+7
-0
vispa/extensions/file2/static/js/vue/navbar.js
vispa/extensions/file2/static/js/vue/navbar.js
+15
-0
No files found.
vispa/extensions/file2/static/html/vue/browser.html
View file @
e7c513f5
...
...
@@ -7,6 +7,8 @@
:path=
"path"
:loading=
"loading"
:workspace-id=
"workspaceId"
:view-id=
"view.id"
:dir-names=
"dirNames"
:path-edit.sync=
"pathEdit"
></navbar>
<component
...
...
vispa/extensions/file2/static/html/vue/navbar.html
View file @
e7c513f5
...
...
@@ -24,11 +24,15 @@
@
keyup.enter=
"pathNav"
@
keyup.esc=
"pathEdit = false"
@
blur=
"pathEdit = false"
:list=
"suggestionsId"
>
<button
class=
"btn-nostyle"
@
click=
"pathNav"
><i
class=
"fa fa-arrow-right"
></i></button>
<datalist
:id=
"suggestionsId"
><option
v-for=
"sugg in suggestions"
:value=
"sugg"
/></datalist>
</div>
</div>
<div
class=
"navi-button"
>
...
...
vispa/extensions/file2/static/js/vue/browser.js
View file @
e7c513f5
...
...
@@ -65,6 +65,13 @@ define([
}
return
items
;
},
dirNames
:
function
()
{
return
this
.
filteredItems
.
filter
(
function
(
item
)
{
return
item
.
type
===
"
d
"
;
}).
map
(
function
(
item
)
{
return
item
.
name
;
});
},
sortedItems
:
function
()
{
var
order
=
(
this
.
pref
(
"
dirFirst
"
)
?
[
"
type
"
]
:
[]).
concat
(
this
.
pref
(
"
sortOrder
"
));
return
this
.
filteredItems
.
slice
().
sort
(
function
(
a
,
b
)
{
...
...
vispa/extensions/file2/static/js/vue/navbar.js
View file @
e7c513f5
...
...
@@ -23,6 +23,8 @@ define([
path
:
String
,
loading
:
Boolean
,
workspaceId
:
Number
,
viewId
:
String
,
dirNames
:
Array
,
pathEdit
:
{
type
:
Boolean
,
default
:
false
,
...
...
@@ -66,6 +68,19 @@ define([
},
};
},
suggestions
:
function
()
{
var
prefix
=
this
.
path
+
"
/
"
;
if
(
!
this
.
pathText
.
startsWith
(
prefix
))
return
[];
var
base
=
this
.
pathText
.
replace
(
prefix
,
""
);
return
this
.
dirNames
.
filter
(
function
(
name
)
{
return
name
.
startsWith
(
base
);})
.
map
(
function
(
name
)
{
return
prefix
+
name
;})
.
sort
()
.
slice
(
0
,
10
);
},
suggestionsId
:
function
()
{
return
"
file2_navbar_suggestions_
"
+
this
.
viewId
;
},
},
methods
:
{
pathNav
:
function
()
{
...
...
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