-
Notifications
You must be signed in to change notification settings - Fork 2
/
main-header.html
80 lines (74 loc) · 2.16 KB
/
main-header.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<link rel="import" href="../polymer-1.4.0/polymer.html">
<link rel="stylesheet" href="../bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/corporate-ui/corporate-ui.css">
<link rel="import" href="behaviors/global-behavior.html">
<link rel="import" href="behaviors/state-behavior.html">
<dom-module id="ks-main-header">
<template>
<style>
:host {
display: block;
}
@media (max-width: 991px) {
:host .navbar-default {
position: fixed;
top: 0;
left: 0;
right: 0;
/*z-index: 1030;*/
}
:host .navbar-default .navbar-header[short-name]:not([short-name='']) {
font-size: 0;
}
:host .navbar-default .navbar-header .navbar-symbol:after {
height: 58px;
}
:host .navbar-default .navbar-header[short-name]:not([short-name='']):after {
display: inline-block;
font-size: 16px;
vertical-align: middle;
content: attr(short-name);
}
:host .navbar-default .navbar-header[short-name]:not([short-name='']) button {
font-size: 1.8rem;
}
:host .navbar-default .navbar-toggle:after {
display: block;
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
}
</style>
<nav class="navbar navbar-default" hidden="[[hidden]]">
<div class="navbar-header" short-name$="{{shortName}}">
<a href$="{{siteUrl}}" class="navbar-brand"></a>
{{siteName}}
<a href$="{{siteUrl}}" class="navbar-symbol"></a>
<nav class="nav navbar-nav navbar-right">
<content></content>
</nav>
</div>
</nav>
</template>
<script>
Polymer({
is: 'ks-main-header',
behaviors: [CUIBehaviors.GlobalBehavior, CUIBehaviors.StateBehavior],
properties: {
siteName: String,
shortName: String,
siteUrl: {
type: String,
value: '/'
}
},
attributeChanged: function (name, type) {
this.header(this.getAttribute('disable') == 'true');
}
});
</script>
</dom-module>