Skip to content

Commit 59518f4

Browse files
Updated component to version 2.2.11
1 parent 6ddf894 commit 59518f4

8 files changed

+193
-62
lines changed

RELEASE-NOTES.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
### Version 2.2.11 - July 11, 2017
2+
3+
- **Modal** - Using multiple modals with different `inverted` `blurring` or `closable` settings will now function normally in all cases [#4368](https://github.com/Semantic-Org/Semantic-UI/issues/4368)
4+
- **Modal** - Fixed issue where modal `refresh` was being called on modals even if they are hidden, causing display issues when multiple modals are shown. **Thanks @p2kmgcl** [#5319](https://github.com/Semantic-Org/Semantic-UI/issues/5319)
5+
- **Modal** - Adds new `scrolling content` variation to have a modal with content that scrolls
6+
- **Modal** - Adds `tiny` and `mini` sized modals **Thanks @Banandrew** [#5123](https://github.com/Semantic-Org/Semantic-UI/issues/5123)
7+
18
### Version 2.2.10 - March 28, 2017
29

310
- **Modal** - `onDeny` and `onApprove` callbacks can no longer occur multiple times if you rapidly click a approve/deny button in a. #4479

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
"framework"
1616
],
1717
"license": "MIT",
18-
"version": "2.2.10"
18+
"version": "2.2.11"
1919
}

index.js

+42-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* # Semantic UI 2.2.10 - Modal
2+
* # Semantic UI 2.2.11 - Modal
33
* http://github.com/semantic-org/semantic-ui/
44
*
55
*
@@ -109,25 +109,15 @@ module.exports = function(parameters) {
109109
var
110110
defaultSettings = {
111111
debug : settings.debug,
112-
dimmerName : 'modals',
113-
duration : {
114-
show : settings.duration,
115-
hide : settings.duration
116-
}
112+
dimmerName : 'modals'
117113
},
118114
dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings)
119115
;
120-
if(settings.inverted) {
121-
dimmerSettings.variation = (dimmerSettings.variation !== undefined)
122-
? dimmerSettings.variation + ' inverted'
123-
: 'inverted'
124-
;
125-
}
126116
if($.fn.dimmer === undefined) {
127117
module.error(error.dimmer);
128118
return;
129119
}
130-
module.debug('Creating dimmer with settings', dimmerSettings);
120+
module.debug('Creating dimmer');
131121
$dimmable = $context.dimmer(dimmerSettings);
132122
if(settings.detachable) {
133123
module.verbose('Modal is detachable, moving content into dimmer');
@@ -136,9 +126,6 @@ module.exports = function(parameters) {
136126
else {
137127
module.set.undetached();
138128
}
139-
if(settings.blurring) {
140-
$dimmable.addClass(className.blurring);
141-
}
142129
$dimmer = $dimmable.dimmer('get dimmer');
143130
},
144131
id: function() {
@@ -291,7 +278,7 @@ module.exports = function(parameters) {
291278
}
292279
},
293280
resize: function() {
294-
if( $dimmable.dimmer('is active') ) {
281+
if( $dimmable.dimmer('is active') && ( module.is.animating() || module.is.active() ) ) {
295282
requestAnimationFrame(module.refresh);
296283
}
297284
}
@@ -312,6 +299,7 @@ module.exports = function(parameters) {
312299
: function(){}
313300
;
314301
module.refreshModals();
302+
module.set.dimmerSettings();
315303
module.showModal(callback);
316304
},
317305

@@ -605,6 +593,42 @@ module.exports = function(parameters) {
605593
;
606594
}
607595
},
596+
dimmerSettings: function() {
597+
if($.fn.dimmer === undefined) {
598+
module.error(error.dimmer);
599+
return;
600+
}
601+
var
602+
defaultSettings = {
603+
debug : settings.debug,
604+
dimmerName : 'modals',
605+
variation : false,
606+
closable : 'auto',
607+
duration : {
608+
show : settings.duration,
609+
hide : settings.duration
610+
}
611+
},
612+
dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings)
613+
;
614+
if(settings.inverted) {
615+
dimmerSettings.variation = (dimmerSettings.variation !== undefined)
616+
? dimmerSettings.variation + ' inverted'
617+
: 'inverted'
618+
;
619+
$dimmer.addClass(className.inverted);
620+
}
621+
else {
622+
$dimmer.removeClass(className.inverted);
623+
}
624+
if(settings.blurring) {
625+
$dimmable.addClass(className.blurring);
626+
}
627+
else {
628+
$dimmable.removeClass(className.blurring);
629+
}
630+
$context.dimmer('setting', dimmerSettings);
631+
},
608632
screenHeight: function() {
609633
if( module.can.fit() ) {
610634
$body.css('height', '');
@@ -913,6 +937,7 @@ _module.exports.settings = {
913937
active : 'active',
914938
animating : 'animating',
915939
blurring : 'blurring',
940+
inverted : 'inverted',
916941
scrolling : 'scrolling',
917942
undetached : 'undetached'
918943
}

modal.css

+96-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* # Semantic UI 2.2.10 - Modal
2+
* # Semantic UI 2.2.11 - Modal
33
* http://github.com/semantic-org/semantic-ui/
44
*
55
*
@@ -103,12 +103,10 @@
103103
}
104104
.ui.modal > .image.content {
105105
display: -webkit-box;
106-
display: -webkit-flex;
107106
display: -ms-flexbox;
108107
display: flex;
109108
-webkit-box-orient: horizontal;
110109
-webkit-box-direction: normal;
111-
-webkit-flex-direction: row;
112110
-ms-flex-direction: row;
113111
flex-direction: row;
114112
}
@@ -117,46 +115,43 @@
117115
.ui.modal > .content > .image {
118116
display: block;
119117
-webkit-box-flex: 0;
120-
-webkit-flex: 0 1 auto;
121118
-ms-flex: 0 1 auto;
122119
flex: 0 1 auto;
123120
width: '';
124-
-webkit-align-self: top;
125-
-ms-flex-item-align: top;
126-
align-self: top;
121+
-ms-flex-item-align: top;
122+
-ms-grid-row-align: top;
123+
align-self: top;
127124
}
128125
.ui.modal > [class*="top aligned"] {
129-
-webkit-align-self: top;
130-
-ms-flex-item-align: top;
131-
align-self: top;
126+
-ms-flex-item-align: top;
127+
-ms-grid-row-align: top;
128+
align-self: top;
132129
}
133130
.ui.modal > [class*="middle aligned"] {
134-
-webkit-align-self: middle;
135-
-ms-flex-item-align: middle;
136-
align-self: middle;
131+
-ms-flex-item-align: middle;
132+
-ms-grid-row-align: middle;
133+
align-self: middle;
137134
}
138135
.ui.modal > [class*="stretched"] {
139-
-webkit-align-self: stretch;
140-
-ms-flex-item-align: stretch;
141-
align-self: stretch;
136+
-ms-flex-item-align: stretch;
137+
-ms-grid-row-align: stretch;
138+
align-self: stretch;
142139
}
143140

144141
/* Description */
145142
.ui.modal > .content > .description {
146143
display: block;
147144
-webkit-box-flex: 1;
148-
-webkit-flex: 1 0 auto;
149145
-ms-flex: 1 0 auto;
150146
flex: 1 0 auto;
151147
min-width: 0px;
152-
-webkit-align-self: top;
153-
-ms-flex-item-align: top;
154-
align-self: top;
148+
-ms-flex-item-align: top;
149+
-ms-grid-row-align: top;
150+
align-self: top;
155151
}
156152
.ui.modal > .content > .icon + .description,
157153
.ui.modal > .content > .image + .description {
158154
-webkit-box-flex: 0;
159-
-webkit-flex: 0 1 auto;
160155
-ms-flex: 0 1 auto;
161156
flex: 0 1 auto;
162157
min-width: '';
@@ -253,7 +248,6 @@
253248
.ui.modal .image.content {
254249
-webkit-box-orient: vertical;
255250
-webkit-box-direction: normal;
256-
-webkit-flex-direction: column;
257251
-ms-flex-direction: column;
258252
flex-direction: column;
259253
}
@@ -394,6 +388,12 @@
394388
}
395389
}
396390

391+
/* Scrolling Content */
392+
.ui.modal .scrolling.content {
393+
max-height: calc(70vh);
394+
overflow: auto;
395+
}
396+
397397
/*--------------
398398
Full Screen
399399
---------------*/
@@ -423,6 +423,80 @@
423423
font-size: 1rem;
424424
}
425425

426+
/* Mini */
427+
.ui.mini.modal > .header:not(.ui) {
428+
font-size: 1.3em;
429+
}
430+
431+
/* Mini Modal Width */
432+
@media only screen and (max-width: 767px) {
433+
.ui.mini.modal {
434+
width: 95%;
435+
margin: 0em 0em 0em -47.5%;
436+
}
437+
}
438+
@media only screen and (min-width: 768px) {
439+
.ui.mini.modal {
440+
width: 35.2%;
441+
margin: 0em 0em 0em -17.6%;
442+
}
443+
}
444+
@media only screen and (min-width: 992px) {
445+
.ui.mini.modal {
446+
width: 340px;
447+
margin: 0em 0em 0em -170px;
448+
}
449+
}
450+
@media only screen and (min-width: 1200px) {
451+
.ui.mini.modal {
452+
width: 360px;
453+
margin: 0em 0em 0em -180px;
454+
}
455+
}
456+
@media only screen and (min-width: 1920px) {
457+
.ui.mini.modal {
458+
width: 380px;
459+
margin: 0em 0em 0em -190px;
460+
}
461+
}
462+
463+
/* mini */
464+
.ui.small.modal > .header:not(.ui) {
465+
font-size: 1.3em;
466+
}
467+
468+
/* Tiny Modal Width */
469+
@media only screen and (max-width: 767px) {
470+
.ui.tiny.modal {
471+
width: 95%;
472+
margin: 0em 0em 0em -47.5%;
473+
}
474+
}
475+
@media only screen and (min-width: 768px) {
476+
.ui.tiny.modal {
477+
width: 52.8%;
478+
margin: 0em 0em 0em -26.4%;
479+
}
480+
}
481+
@media only screen and (min-width: 992px) {
482+
.ui.tiny.modal {
483+
width: 510px;
484+
margin: 0em 0em 0em -255px;
485+
}
486+
}
487+
@media only screen and (min-width: 1200px) {
488+
.ui.tiny.modal {
489+
width: 540px;
490+
margin: 0em 0em 0em -270px;
491+
}
492+
}
493+
@media only screen and (min-width: 1920px) {
494+
.ui.tiny.modal {
495+
width: 570px;
496+
margin: 0em 0em 0em -285px;
497+
}
498+
}
499+
426500
/* Small */
427501
.ui.small.modal > .header:not(.ui) {
428502
font-size: 1.3em;

0 commit comments

Comments
 (0)