-
Notifications
You must be signed in to change notification settings - Fork 2
/
main-content.html
102 lines (90 loc) · 6.3 KB
/
main-content.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<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">
<script src="polyfill/polyfills.js"></script>
<script src="config.js"></script>
<link rel="import" href="behaviors/state-behavior.html">
<dom-module id="ks-main-content">
<template>
<style>
:host {
display: block;
flex-grow: 1;
flex-shrink: 0;
word-break: break-word;
}
</style>
<content></content>
</template>
<script>
Polymer({
is: 'ks-main-content',
behaviors: [CUIBehaviors.StateBehavior],
ready: function(){
var favicons = [{rel: "shortcut icon", href: "https://static.scania.com/resources/logotype/scania/favicon/favicon.ico"},
{ rel: "apple-touch-icon", href: "https://static.scania.com/resources/logotype/scania/favicon/apple-icon-57x57.png", sizes: "57x57"},
{ rel: "apple-touch-icon", href: "https://static.scania.com/resources/logotype/scania/favicon/apple-icon-60x60.png", sizes: "60x60"},
{ rel: "apple-touch-icon", href: "https://static.scania.com/resources/logotype/scania/favicon/apple-icon-60x60.png", sizes: "60x60"},
{ rel: "apple-touch-icon", href: "https://static.scania.com/resources/logotype/scania/favicon/apple-icon-76x76.png", sizes:"76x76"},
{ rel: "apple-touch-icon", href: "https://static.scania.com/resources/logotype/scania/favicon/apple-icon-114x114.png", sizes: "114x114"},
{ rel: "apple-touch-icon", href: "https://static.scania.com/resources/logotype/scania/favicon/apple-icon-120x120.png", sizes: "120x120"},
{ rel: "apple-touch-icon", href: "https://static.scania.com/resources/logotype/scania/favicon/apple-icon-144x144.png", sizes: "144x144"},
{ rel: "apple-touch-icon", href: "https://static.scania.com/resources/logotype/scania/favicon/apple-icon-152x152.png", sizes: "152x152"},
{ rel: "apple-touch-icon", href: "https://static.scania.com/resources/logotype/scania/favicon/apple-icon-180x180.png", sizes: "180x180"},
{ rel: "icon", href: "https://static.scania.com/resources/logotype/scania/favicon/android-icon-192x192.png", sizes: "192x192"},
{ rel: "icon", href: "https://static.scania.com/resources/logotype/scania/favicon/favicon-32x32.png", sizes: "32x32"},
{ rel: "icon", href: "https://static.scania.com/resources/logotype/scania/favicon/favicon-96x96.png", sizes: "96x96"},
{ rel: "icon", href: "https://static.scania.com/resources/logotype/scania/favicon/favicon-16x16.png", sizes: "16x16"},
{ rel: "manifest", href: "https://static.scania.com/resources/logotype/scania/favicon/manifest.json"}
],
metaData = [{name: "msapplication-TileColor", content: "#000"},
{name: "msapplication-TileImage", content: "https://static.scania.com/resources/logotype/scania/favicon/ms-icon-144x144.png"}
],
styleContent = 'body{display:flex;flex-direction:column;}[hidden]{display: none!important;}body[ks-primary-submenu-open] .navbar.navbar-default .container-fluid{background-color:#f7f7f7;}' +
'body[ks-primary-submenu-open] .collapse.navbar-collapse{margin-bottom:36px;background-color:#fff;}body[ks-main-header-hidden] .sticky-toolbar{top:58px;}' +
'body[ks-primary-submenu-open][ks-fullscreen-mode] .collapse.navbar-collapse{margin-bottom:0;}' +
'body[ks-sticky-mode] .sticky-toolbar{z-index:1011;top:55px;position:fixed;}' +
'body[ks-fullscreen-mode] .sticky-toolbar{top:5px;} body[ks-fullscreen-mode] ks-main-content{top:35px;}' +
'body[ks-top-banner]:not([ks-main-header-hidden]):not([ks-sticky-mode]):not([ks-fullscreen-mode]) .sticky-toolbar{top:168px;}' +
'body[ks-top-banner][ks-main-header-hidden]:not([ks-sticky-mode]):not([ks-fullscreen-mode]) .sticky-toolbar{top:97px;}'+
'@media (max-width: 991px) {body[ks-main-header-hidden] .navbar.navbar-default, ' +
'body[ks-main-header-hidden] .navbar.navbar-default .container-fluid{background-color:transparent;}' +
'body[ks-main-header-hidden] .navbar.navbar-default .navbar-header{border-bottom:none;}' +
'body[ks-main-header-hidden] .navbar.navbar-default .navbar-header button.navbar-toggle{border-right:none;left:19px}' +
'body[ks-main-header-hidden] .navbar.navbar-default .navbar-header button.navbar-toggle:focus{background-color:#f5f5f5;}' +
'body[ks-main-header-hidden] .navbar.navbar-default .navbar-header button.navbar-toggle:hover{background-color:#f5f5f5;}' +
'body[ks-main-header-hidden] .navbar.navbar-default .navbar-header button.navbar-toggle.collapsed{background-color:transparent;}}' +
'body[ks-sticky-mode]:not([ks-main-header-hidden]) .navbar-nav.navbar-right:not([dropdownmenu]) {padding-right: 60px;}',
style = document.createElement('style');
style.textContent = styleContent;
document.head.appendChild(style);
favicons.forEach(function(favicon){
var link = document.createElement('link');
link.rel = favicon.rel;
link.href = favicon.href;
link.sizes = favicon.sizes;
document.head.appendChild(link);
});
metaData.forEach(function(content){
var meta = document.createElement('meta');
meta.name = content.name;
meta.content = content.content;
document.head.appendChild(meta);
});
// Add corporate-ui version to html tag
try {
if (window.corparateUiLightConfig) {
var config = window.corparateUiLightConfig,
selectedTag = document.getElementsByTagName('html')[0];
if (config.corporateUIVersion && selectedTag) {
selectedTag.setAttribute('corporate-ui-version', config.corporateUIVersion);
}
}
} catch (err) {}
// Todo: Why do we add "unresolved" to the body tag.
// if it is needed, then we need to find a way to remove it after the component has finished to load.
// this.unresolved();
}
});
</script>
</dom-module>