Skip to content

Commit b6b0e96

Browse files
authored
Merge pull request #170 from digi-trust/master
CMP locator frame, tweaks to responsiveness
2 parents b865717 + 7bc8fec commit b6b0e96

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

src/components/popup/intro/intro.less

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
.flexColumn {
2-
flex-direction: column;
2+
@media (max-width: 480px) {
3+
flex-direction: row;
4+
}
5+
@media (min-width: 481px) {
6+
flex-direction: column;
7+
}
38
}
49

10+
511
div.intro {
612
align-items: center;
713
padding: 0 4em;
814
max-height: 100%;
915

1016
.top {
11-
max-height: 425px;
1217
margin-bottom: 75px;
1318
overflow: auto;
1419

20+
@media (max-width: 480px) {
21+
max-height: calc(100vh - 75px);
22+
}
23+
@media (min-width: 481px) {
24+
max-height: 425px;
25+
}
26+
1527
.logo {
1628
display: block;
1729
margin: 20px auto 10px auto;
@@ -27,6 +39,7 @@ div.intro {
2739
.description {
2840
margin: 2em 0;
2941
overflow: auto;
42+
max-height: 150px;
3043
text-align: center;
3144
}
3245
.options {

src/lib/init.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,21 @@ export function init(configUpdates) {
6666
cmp.gdprAppliesLanguage = response.language;
6767
cmp.gdprAppliesLocation = response.location;
6868
}).then((response) => {
69+
function addLocatorFrame() {
70+
if (!window.frames['__cmpLocator']) {
71+
if (document.body) {
72+
var frame = document.createElement('iframe');
73+
frame.style.display = 'none';
74+
frame.name = '__cmpLocator';
75+
document.body.appendChild(frame);
76+
}
77+
else {
78+
setTimeout(addLocatorFrame, 5);
79+
}
80+
}
81+
}
82+
83+
addLocatorFrame();
6984
store.updateIsEU(response.applies);
7085

7186
// Render the UI

0 commit comments

Comments
 (0)