Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grew
grew_match
Commits
684becdf
Commit
684becdf
authored
Oct 10, 2020
by
Bruno Guillaume
Browse files
deal with undefined meta
parent
cd84c723
Changes
2
Hide whitespace changes
Inline
Side-by-side
js/main.js
View file @
684becdf
...
...
@@ -143,15 +143,17 @@ $(document).ready(function() {
// ==================================================================================
function
fill_metadata
(
meta
)
{
if
(
meta
.
length
==
0
)
{
$
(
'
#meta-panel
'
).
hide
();
if
(
meta
===
undefined
||
meta
.
length
==
0
)
{
$
(
'
#md
'
).
hide
();
$
(
'
#meta-collapse
'
).
hide
();
}
else
{
html
=
""
meta
.
forEach
(
item
=>
{
html
+=
'
<p><b>
'
+
item
.
key
+
'
= </b>
'
+
item
.
value
+
'
</p>
\n
'
;
});
$
(
'
#metadata
'
).
html
(
html
);
$
(
'
#meta-panel
'
).
show
();
$
(
'
#md
'
).
show
();
$
(
'
#meta-collapse
'
).
show
();
}
}
...
...
run.html
View file @
684becdf
...
...
@@ -268,7 +268,7 @@
<div
id=
"meta-panel"
class=
"panel panel-default"
style=
"margin-bottom:4px;"
>
<a
id=
"md"
onclick=
"toggle_metadata_icon()"
data-toggle=
"collapse"
href=
"#collapse
1
"
class=
"collapsed"
>
<a
id=
"md"
onclick=
"toggle_metadata_icon()"
data-toggle=
"collapse"
href=
"#
meta-
collapse"
class=
"collapsed"
>
<button
class=
"btn btn-primary btn-sm"
>
Metadata
<span
id=
"md-icon"
class=
"glyphicon glyphicon-chevron-right"
>
</span>
</button>
...
...
@@ -283,9 +283,9 @@
<span
href=
""
class=
"glyphicon glyphicon-export"
></span>
</button>
</a>
</div>
<div
id=
"collapse1"
class=
"panel-collapse collapse"
>
<div
id=
"meta-collapse"
class=
"panel-collapse collapse"
>
<div
id=
"metadata"
class=
"panel-body"
>
</div>
</div>
...
...
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