Skip to content

Commit 6c6824f

Browse files
ciar4nHLeithner
authored andcommitted
Compact image modal layout (#22475)
* Media field style and layout * Small screen considerations * Tweaks * Revert js change * indent * Fix scroll in chrome
1 parent 5d2bb49 commit 6c6824f

File tree

9 files changed

+77
-53
lines changed

9 files changed

+77
-53
lines changed

administrator/components/com_media/views/images/tmpl/default.php

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,30 @@
6565
?>
6666
<div class="container-popup">
6767

68-
<form action="index.php?option=com_media&amp;asset=<?php echo $asset; ?>&amp;author=<?php echo $author; ?>" class="form-vertical" id="imageForm" method="post" enctype="multipart/form-data">
68+
<form action="index.php?option=com_media&amp;asset=<?php echo $asset; ?>&amp;author=<?php echo $author; ?>" class="form-horizontal" id="imageForm" method="post" enctype="multipart/form-data">
6969

7070
<div id="messages" style="display: none;">
7171
<span id="message"></span><?php echo JHtml::_('image', 'media/dots.gif', '...', array('width' => 22, 'height' => 12), true); ?>
7272
</div>
7373

7474
<div class="well">
75-
<div class="row">
76-
<div class="span12 control-group">
75+
<div class="row-fluid">
76+
<div class="span8 control-group">
7777
<div class="control-label">
78-
<label class="control-label" for="folder"><?php echo JText::_('COM_MEDIA_DIRECTORY'); ?></label>
78+
<label for="folder"><?php echo JText::_('COM_MEDIA_DIRECTORY'); ?></label>
7979
</div>
8080
<div class="controls">
8181
<?php echo $this->folderList; ?>
8282
<button class="btn" type="button" id="upbutton" title="<?php echo JText::_('COM_MEDIA_DIRECTORY_UP'); ?>"><?php echo JText::_('COM_MEDIA_UP'); ?></button>
8383
</div>
8484
</div>
85-
<div class="pull-right">
86-
<button class="btn btn-success button-save-selected" type="button" <?php if (!empty($onClick)) :
87-
// This is for Mootools compatibility ?>onclick="<?php echo $onClick; ?>"<?php endif; ?> data-dismiss="modal"><?php echo JText::_('COM_MEDIA_INSERT'); ?></button>
88-
<button class="btn button-cancel" type="button" onclick="window.parent.jQuery('.modal.in').modal('hide');<?php if (!empty($onClick)) :
89-
// This is for Mootools compatibility ?>parent.jModalClose();<?php endif ?>" data-dismiss="modal"><?php echo JText::_('JCANCEL'); ?></button>
85+
<div class="span4 control-group">
86+
<div class="pull-right">
87+
<button class="btn btn-success button-save-selected" type="button" <?php if (!empty($onClick)) :
88+
// This is for Mootools compatibility ?>onclick="<?php echo $onClick; ?>"<?php endif; ?> data-dismiss="modal"><?php echo JText::_('COM_MEDIA_INSERT'); ?></button>
89+
<button class="btn button-cancel" type="button" onclick="window.parent.jQuery('.modal.in').modal('hide');<?php if (!empty($onClick)) :
90+
// This is for Mootools compatibility ?>parent.jModalClose();<?php endif ?>" data-dismiss="modal"><?php echo JText::_('JCANCEL'); ?></button>
91+
</div>
9092
</div>
9193
</div>
9294
</div>
@@ -95,15 +97,20 @@
9597

9698
<div class="well">
9799
<div class="row-fluid">
98-
<div class="span6 control-group">
100+
<div class="span12 control-group">
99101
<div class="control-label">
100102
<label for="f_url"><?php echo JText::_('COM_MEDIA_IMAGE_URL'); ?></label>
101103
</div>
102104
<div class="controls">
103105
<input type="text" id="f_url" value="" />
104106
</div>
105107
</div>
106-
<?php if (!$this->state->get('field.id')) : ?>
108+
</div>
109+
</div>
110+
111+
<?php if (!$this->state->get('field.id')) : ?>
112+
<div class="well">
113+
<div class="row-fluid">
107114
<div class="span6 control-group">
108115
<div class="control-label">
109116
<label title="<?php echo JText::_('COM_MEDIA_ALIGN_DESC'); ?>" class="noHtmlTip" for="f_align"><?php echo JText::_('COM_MEDIA_ALIGN'); ?></label>
@@ -117,9 +124,7 @@
117124
</select>
118125
</div>
119126
</div>
120-
<?php endif; ?>
121-
</div>
122-
<?php if (!$this->state->get('field.id')) : ?>
127+
</div>
123128
<div class="row-fluid">
124129
<div class="span6 control-group">
125130
<div class="control-label">
@@ -161,13 +166,11 @@
161166
</div>
162167
</div>
163168
</div>
164-
<?php endif; ?>
165-
166169
<input type="hidden" id="dirPath" name="dirPath" />
167170
<input type="hidden" id="f_file" name="f_file" />
168171
<input type="hidden" id="tmpl" name="component" />
169-
170172
</div>
173+
<?php endif; ?>
171174
</form>
172175

173176
<?php if ($user->authorise('core.create', 'com_media')) : ?>

administrator/components/com_media/views/imageslist/tmpl/default.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
@media (max-width: 767px) {
2828
li.imgOutline.thumbnail.height-80.width-80.center {
2929
float: right;
30-
margin-right: 15px;
3130
}
3231
}
3332
'
@@ -40,7 +39,6 @@
4039
@media (max-width: 767px) {
4140
li.imgOutline.thumbnail.height-80.width-80.center {
4241
float: left;
43-
margin-left: 15px;
4442
}
4543
}
4644
'

administrator/templates/isis/css/template-rtl.css

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7766,15 +7766,9 @@ ul.manager .height-50 .icon-folder-2 {
77667766
line-height: 35px;
77677767
font-size: 30px;
77687768
}
7769-
#imageForm {
7770-
margin: -25px 0 0;
7771-
}
77727769
#imageForm .well {
77737770
margin-bottom: 5px;
77747771
}
7775-
.thumbnails-media {
7776-
margin-left: 0;
7777-
}
77787772
.thumbnails-media .thumbnail {
77797773
background-color: #f4f4f4;
77807774
border-radius: 3px;
@@ -7783,8 +7777,7 @@ ul.manager .height-50 .icon-folder-2 {
77837777
padding: 0px;
77847778
height: 100px;
77857779
width: 100px;
7786-
margin: 8px 16px;
7787-
margin-left: 0 !important;
7780+
margin: 8px;
77887781
position: relative;
77897782
text-align: center;
77907783
overflow: hidden;
@@ -7969,6 +7962,7 @@ ul.manager .height-50 .icon-folder-2 {
79697962
}
79707963
#mediamanager-form {
79717964
margin: 0 -10px;
7965+
overflow-x: hidden;
79727966
}
79737967
#mediamanager-form > .muted {
79747968
padding: 0px;
@@ -7980,10 +7974,14 @@ ul.manager .height-50 .icon-folder-2 {
79807974
#mediamanager-form .checkbox input {
79817975
margin-top: 3px;
79827976
}
7977+
#mediamanager-form .thumbnails {
7978+
margin: 0 -8px;
7979+
overflow-x: hidden;
7980+
}
79837981
#mediamanager-form .thumbnails .thumbnail {
79847982
height: 120px;
79857983
width: 120px;
7986-
margin: 0 18px 18px 0;
7984+
margin: 8px;
79877985
}
79887986
#mediamanager-form .thumbnails .imgThumb label,
79897987
#mediamanager-form .thumbnails .imgTotal {
@@ -8047,6 +8045,7 @@ body.modal-open {
80478045
padding: 0;
80488046
width: 100%;
80498047
height: auto;
8048+
max-height: none;
80508049
}
80518050
.modal-body .container-fluid {
80528051
padding-top: 15px;
@@ -8065,7 +8064,10 @@ body.modal-open {
80658064
}
80668065
}
80678066
.container-popup {
8068-
padding: 28px 10px 10px 10px;
8067+
padding: 10px;
8068+
}
8069+
.field-media-wrapper iframe {
8070+
max-height: 75vh;
80698071
}
80708072
body .navbar,
80718073
body .navbar-fixed-top {

administrator/templates/isis/css/template.css

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7766,15 +7766,9 @@ ul.manager .height-50 .icon-folder-2 {
77667766
line-height: 35px;
77677767
font-size: 30px;
77687768
}
7769-
#imageForm {
7770-
margin: -25px 0 0;
7771-
}
77727769
#imageForm .well {
77737770
margin-bottom: 5px;
77747771
}
7775-
.thumbnails-media {
7776-
margin-left: 0;
7777-
}
77787772
.thumbnails-media .thumbnail {
77797773
background-color: #f4f4f4;
77807774
border-radius: 3px;
@@ -7783,8 +7777,7 @@ ul.manager .height-50 .icon-folder-2 {
77837777
padding: 0px;
77847778
height: 100px;
77857779
width: 100px;
7786-
margin: 8px 16px;
7787-
margin-left: 0 !important;
7780+
margin: 8px;
77887781
position: relative;
77897782
text-align: center;
77907783
overflow: hidden;
@@ -7969,6 +7962,7 @@ ul.manager .height-50 .icon-folder-2 {
79697962
}
79707963
#mediamanager-form {
79717964
margin: 0 -10px;
7965+
overflow-x: hidden;
79727966
}
79737967
#mediamanager-form > .muted {
79747968
padding: 0px;
@@ -7980,10 +7974,14 @@ ul.manager .height-50 .icon-folder-2 {
79807974
#mediamanager-form .checkbox input {
79817975
margin-top: 3px;
79827976
}
7977+
#mediamanager-form .thumbnails {
7978+
margin: 0 -8px;
7979+
overflow-x: hidden;
7980+
}
79837981
#mediamanager-form .thumbnails .thumbnail {
79847982
height: 120px;
79857983
width: 120px;
7986-
margin: 0 18px 18px 0;
7984+
margin: 8px;
79877985
}
79887986
#mediamanager-form .thumbnails .imgThumb label,
79897987
#mediamanager-form .thumbnails .imgTotal {
@@ -8047,6 +8045,7 @@ body.modal-open {
80478045
padding: 0;
80488046
width: 100%;
80498047
height: auto;
8048+
max-height: none;
80508049
}
80518050
.modal-body .container-fluid {
80528051
padding-top: 15px;
@@ -8065,7 +8064,10 @@ body.modal-open {
80658064
}
80668065
}
80678066
.container-popup {
8068-
padding: 28px 10px 10px 10px;
8067+
padding: 10px;
8068+
}
8069+
.field-media-wrapper iframe {
8070+
max-height: 75vh;
80698071
}
80708072
body .navbar,
80718073
body .navbar-fixed-top {

administrator/templates/isis/html/layouts/joomla/form/field/media.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
data-url="<?php echo $url; ?>"
9494
data-modal=".modal"
9595
data-modal-width="100%"
96-
data-modal-height="400px"
96+
data-modal-height="645px"
9797
data-input=".field-media-input"
9898
data-button-select=".button-select"
9999
data-button-clear=".button-clear"
@@ -112,7 +112,6 @@
112112
array(
113113
'title' => JText::_('JLIB_FORM_CHANGE_IMAGE'),
114114
'closeButton' => true,
115-
'footer' => '<button type="button" class="btn" data-dismiss="modal">' . JText::_('JCANCEL') . '</button>',
116115
)
117116
);
118117

administrator/templates/isis/less/blocks/_media.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ ul.manager .height-50 .icon-folder-2 {
99
}
1010

1111
#imageForm {
12-
margin: -25px 0 0;
1312
.well {
1413
margin-bottom: 5px;
1514
}
1615
}
1716
.thumbnails-media {
1817
@thumbSize:100px;
19-
margin-left: 0;
2018
.thumbnail {
2119
background-color: #f4f4f4;
2220
border-radius: @inputBorderRadius;
@@ -25,8 +23,7 @@ ul.manager .height-50 .icon-folder-2 {
2523
padding: 0px;
2624
height: @thumbSize;
2725
width: @thumbSize;
28-
margin: 8px 16px;
29-
margin-left: 0 !important;
26+
margin: 8px;
3027
position: relative;
3128
text-align: center;
3229
overflow: hidden;
@@ -203,6 +200,7 @@ ul.manager .height-50 .icon-folder-2 {
203200
}
204201
#mediamanager-form {
205202
margin: 0 -10px;
203+
overflow-x: hidden;
206204
> .muted {
207205
padding: 0px;
208206
}
@@ -214,10 +212,12 @@ ul.manager .height-50 .icon-folder-2 {
214212
}
215213
}
216214
.thumbnails {
215+
margin: 0 -8px;
216+
overflow-x: hidden;
217217
.thumbnail {
218218
height: 120px;
219219
width: 120px;
220-
margin: 0 18px 18px 0;
220+
margin: 8px
221221
}
222222
.imgThumb label, .imgTotal {
223223
line-height: 120px;

administrator/templates/isis/less/blocks/_modals.less

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ body.modal-open {
2525
padding: 0;
2626
width: 100%;
2727
height: auto;
28+
max-height: none;
2829
.container-fluid {
2930
padding-top: 15px;
3031
padding-bottom: 15px;
@@ -46,7 +47,12 @@ body.modal-open {
4647
}
4748
}
4849

49-
/* Component pop-up */
50+
// Component pop-up
5051
.container-popup {
51-
padding: 28px 10px 10px 10px;
52+
padding: 10px;
53+
}
54+
55+
// Media modal
56+
.field-media-wrapper iframe {
57+
max-height: 75vh;
5258
}

media/media/css/popup-imagelist.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
* @license GNU General Public License version 2 or later; see LICENSE.txt
44
*/
55

6+
.contentpane {
7+
padding: 0 !important;
8+
overflow-x: hidden;
9+
}
10+
611
.item {
712
float: left;
813
border: 1px solid #ccc !important;
@@ -64,7 +69,7 @@ html>body .item img {
6469
}
6570

6671
.thumbnails.thumbnails-media {
67-
margin-left: 0;
72+
margin: 0 -8px;
6873
}
6974
.thumbnails-media .thumbnail {
7075
background-color: #f4f4f4;
@@ -74,8 +79,7 @@ html>body .item img {
7479
padding: 0px;
7580
height: 100px;
7681
width: 100px;
77-
margin: 8px 16px;
78-
margin-left: 0 !important;
82+
margin: 8px;
7983
position: relative;
8084
text-align: center;
8185
overflow: hidden;

media/media/css/popup-imagemanager.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
* @license GNU General Public License version 2 or later; see LICENSE.txt
44
*/
55

6+
@media only screen and (min-width: 768px) {
7+
#imageForm .control-group,
8+
#uploadform .control-group {
9+
margin-bottom: 0;
10+
}
11+
}
12+
13+
#uploadform.well {
14+
margin-bottom: -26px;
15+
}
16+
617
img {
718
border: 0 none;
819
}
@@ -25,14 +36,13 @@ button:hover {
2536

2637
iframe {
2738
width: 100%;
28-
overflow-x: false;
2939
border: 0 none;
3040
margin: 0 0 0.5em 0;
3141
padding: 0;
3242
}
3343

3444
iframe#imageframe {
35-
height: 200px;
45+
height: 350px;
3646
}
3747

3848
a:hover {

0 commit comments

Comments
 (0)