Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SiB Router
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
19
Issues
19
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Startin blox
framework
SiB Router
Commits
85e5b3c4
Commit
85e5b3c4
authored
Mar 19, 2019
by
Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: resource is now defined as well on DOMContentLoaded
parent
c358adef
Pipeline
#2801
passed with stage
in 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/sib-router.js
src/sib-router.js
+3
-3
No files found.
src/sib-router.js
View file @
85e5b3c4
...
...
@@ -38,13 +38,13 @@ export default class SIBRouter extends HTMLElement {
return
this
.
querySelectorAll
(
'
sib-route
'
);
}
display
(
routeName
=
this
.
currentRouteName
,
resource
,
keepURL
=
false
)
{
display
(
routeName
=
this
.
currentRouteName
,
keepURL
=
false
)
{
for
(
let
route
of
this
.
routes
)
{
if
(
routeName
===
route
.
name
)
{
route
.
activate
(
keepURL
);
this
.
dispatchEvent
(
new
CustomEvent
(
'
navigate
'
,
{
detail
:
{
route
:
routeName
,
resource
},
detail
:
{
route
:
routeName
,
resource
:
{
id
:
route
.
resourceId
}
},
}),
);
}
else
{
...
...
@@ -82,7 +82,7 @@ export default class SIBRouter extends HTMLElement {
const
prefix
=
this
.
useHash
?
'
#
'
:
'
/
'
;
history
.
pushState
({},
routeName
,
prefix
+
path
);
}
this
.
display
(
routeName
,
resource
,
keepURL
);
this
.
display
(
routeName
,
keepURL
);
}
}
customElements
.
define
(
'
sib-router
'
,
SIBRouter
);
...
...
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