Skip to content

Commit e1e415e

Browse files
authored
Make the old modal system responsive and always centred without JS (#23693)
* Make the old modal system responsive and always centred without JS * Update UI screenshots * Fix visitor profile popup * More space between subactions * Small update alert and action list design
1 parent 4966871 commit e1e415e

File tree

65 files changed

+267
-219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+267
-219
lines changed
Lines changed: 2 additions & 2 deletions
Loading

β€Žplugins/CoreAdminHome/stylesheets/whatIsNew.lessβ€Ž

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
color: #1976d2 !important;
33
}
44

5-
.what-is-new-popup {
6-
width: calc(80%);
7-
left: calc(10%) !important;
8-
height: auto;
9-
background: #fafafa;
5+
.ui-dialog.what-is-new-popup {
6+
width: 80%;
7+
background: @theme-color-background-tinyContrast;
8+
9+
@media (max-width: 992px) {
10+
width: auto;
11+
}
1012
}

β€Žplugins/CoreHome/javascripts/popover.jsβ€Ž

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@
66
*/
77

88
var Piwik_Popover = (function () {
9-
109
var container = false;
1110
var isOpen = false;
1211
var closeCallback = false;
1312
var isProgrammaticClose = false;
1413
var scrollTopPosition = 0;
1514
var ajaxLoadingRequest = null;
16-
1715
var createContainer = function () {
1816
if (container === false) {
1917
container = $(document.createElement('div')).attr('id', 'Piwik_Popover');
2018
}
19+
if (!$('#Piwik_Popover_Wrapper').length) {
20+
$(document.createElement('div')).attr('id', 'Piwik_Popover_Wrapper').appendTo('body');
21+
}
2122
};
2223

2324
var openPopover = function (title, dialogClass) {
@@ -27,9 +28,13 @@ var Piwik_Popover = (function () {
2728
{
2829
title: title,
2930
modal: true,
30-
width: '1050px',
31+
width: 1050,
3132
resizable: false,
3233
autoOpen: true,
34+
classes: {
35+
"ui-dialog": 'ui-dialog--responsive',
36+
},
37+
appendTo: '#Piwik_Popover_Wrapper',
3338
open: function (event, ui) {
3439
if (dialogClass) {
3540
$(this).parent().addClass(dialogClass).attr('style', '');
@@ -43,11 +48,8 @@ var Piwik_Popover = (function () {
4348

4449
// sometimes the modal can be displayed outside of the current viewport, in this case
4550
// we scroll to it to make sure it's visible. this isn't a perfect workaround, since it
46-
// doesn't center the modal.g
47-
var self = this;
48-
51+
// doesn't center the modal.
4952
scrollTopPosition = $(window).scrollTop();
50-
5153
$('#root').css({
5254
position: 'fixed',
5355
height: $(window).height + scrollTopPosition,
@@ -56,9 +58,6 @@ var Piwik_Popover = (function () {
5658
});
5759

5860
window.scrollTo(0, 0);
59-
60-
centerPopover();
61-
6261
},
6362
close: function (event, ui) {
6463
container.find('div.jqplot-target').trigger('piwikDestroyPlot');
@@ -108,18 +107,6 @@ var Piwik_Popover = (function () {
108107
isOpen = true;
109108
};
110109

111-
var centerPopover = function () {
112-
if (container !== false) {
113-
$('.ui-dialog').css({margin: '0 0'});
114-
container.dialog("option", "position", {my: 'center', at: 'center', of: '.ui-widget-overlay', collision: 'fit'});
115-
// in some cases jQuery UI fails to place the dialog correctly and set the top values to something negative
116-
if ($('.ui-dialog').position().top < 0) {
117-
$('.ui-dialog').css('top', '0');
118-
}
119-
$('.ui-dialog').css({margin: '15px 0'});
120-
}
121-
};
122-
123110
return {
124111

125112
/**
@@ -218,8 +205,6 @@ var Piwik_Popover = (function () {
218205
container.children().each(function (i, childNode) {
219206
piwikHelper.compileVueEntryComponents(childNode);
220207
});
221-
222-
centerPopover();
223208
},
224209

225210
/**
Lines changed: 2 additions & 2 deletions
Loading

β€Žplugins/CoreHome/vue/src/Alert/alert.lessβ€Ž

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,26 @@
1414
border-radius: 2px;
1515
font-size: 14px;
1616
position: relative;
17-
&:before {
17+
18+
@media (max-width: 480px) {
19+
padding: 15px;
20+
}
21+
22+
&::before {
1823
font-family: "matomo";
1924
content: "\e88f";
2025
position: absolute;
2126
left: 20px;
2227
line-height: 100%; // line-height = font-size
2328
font-size: 24px;
24-
margin-top: -3px
29+
margin-top: -3px;
30+
31+
@media (max-width: 480px) {
32+
position: static;
33+
display: block;
34+
margin-bottom: 0.5em;
35+
text-align: center;
36+
}
2537
}
2638

2739
a {

β€Žplugins/CoreVisualizations/stylesheets/jqplot.cssβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181

8282
#Piwik_Popover .rowevolution .alert-info {
8383
margin-left: 0;
84+
margin-right: 0;
8485
}
8586

8687
a.rowevolution-startmulti {
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
Β (0)