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
a5c81134
Commit
a5c81134
authored
Jun 25, 2019
by
Matthieu Fesselier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/dialog-polyfill' into 'master'
bugfix: dialog polyfill Closes
#40
See merge request
!25
parents
6081040d
280400fe
Pipeline
#4064
passed with stage
in 27 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
examples/dialog.html
examples/dialog.html
+1
-0
src/sib-route.js
src/sib-route.js
+8
-9
No files found.
examples/dialog.html
View file @
a5c81134
...
...
@@ -5,6 +5,7 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
/>
<title>
SIB test: sib-router
</title>
<link
rel=
"stylesheet"
href=
"https://cdn.jsdelivr.net/gh/GoogleChrome/dialog-polyfill@master/dist/dialog-polyfill.css"
>
<script
type=
"module"
src=
"../src/index.js"
></script>
<style>
sib-router
{
...
...
src/sib-route.js
View file @
a5c81134
import
dialogPolyfill
from
'
https://cdn.jsdelivr.net/gh/GoogleChrome/dialog-polyfill@master/index.js
'
export
default
class
SIBRoute
extends
HTMLElement
{
constructor
()
{
super
();
...
...
@@ -80,10 +81,8 @@ export default class SIBRoute extends HTMLElement {
}
}
activate
(
keepURL
=
false
)
{
if
(
'
HTMLDialogElement
'
in
window
&&
this
.
view
instanceof
window
.
HTMLDialogElement
)
{
if
(
this
.
view
.
tagName
===
'
DIALOG
'
)
{
dialogPolyfill
.
registerDialog
(
this
.
view
)
if
(
!
this
.
view
.
hasAttribute
(
'
open
'
))
{
this
.
view
.
showModal
();
}
...
...
@@ -95,11 +94,11 @@ export default class SIBRoute extends HTMLElement {
if
(
!
keepURL
)
this
.
updateSubRouters
();
}
hide
()
{
if
(
'
HTMLDialogElement
'
in
window
&&
this
.
view
instanceof
window
.
HTMLDialogElement
)
{
this
.
view
.
close
();
if
(
this
.
view
.
tagName
===
'
DIALOG
'
)
{
dialogPolyfill
.
registerDialog
(
this
.
view
)
if
(
this
.
view
.
hasAttribute
(
'
open
'
))
{
this
.
view
.
close
();
}
}
else
{
this
.
view
.
setAttribute
(
'
hidden
'
,
''
);
}
...
...
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