Skip to content

Commit 6ddf894

Browse files
Updated component to version 2.2.10
1 parent 436b60e commit 6ddf894

9 files changed

+59
-33
lines changed

RELEASE-NOTES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### Version 2.2.10 - March 28, 2017
2+
3+
- **Modal** - `onDeny` and `onApprove` callbacks can no longer occur multiple times if you rapidly click a approve/deny button in a. #4479
4+
15
### Version 2.2.3 - August 21, 2016
26

37
- **Modal** - Modal now includes setting to enable/disable keyboard shortcuts

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.8"
18+
"version": "2.2.10"
1919
}

index.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* # Semantic UI 2.2.8 - Modal
2+
* # Semantic UI 2.2.10 - Modal
33
* http://github.com/semantic-org/semantic-ui/
44
*
55
*
@@ -73,6 +73,8 @@ module.exports = function(parameters) {
7373
element = this,
7474
instance = $module.data(moduleNamespace),
7575

76+
ignoreRepeatedEvents = false,
77+
7678
elementEventNamespace,
7779
id,
7880
observer,
@@ -227,18 +229,24 @@ module.exports = function(parameters) {
227229

228230
event: {
229231
approve: function() {
230-
if(settings.onApprove.call(element, $(this)) === false) {
232+
if(ignoreRepeatedEvents || settings.onApprove.call(element, $(this)) === false) {
231233
module.verbose('Approve callback returned false cancelling hide');
232234
return;
233235
}
234-
module.hide();
236+
ignoreRepeatedEvents = true;
237+
module.hide(function() {
238+
ignoreRepeatedEvents = false;
239+
});
235240
},
236241
deny: function() {
237-
if(settings.onDeny.call(element, $(this)) === false) {
242+
if(ignoreRepeatedEvents || settings.onDeny.call(element, $(this)) === false) {
238243
module.verbose('Deny callback returned false cancelling hide');
239244
return;
240245
}
241-
module.hide();
246+
ignoreRepeatedEvents = true;
247+
module.hide(function() {
248+
ignoreRepeatedEvents = false;
249+
});
242250
},
243251
close: function() {
244252
module.hide();

modal.css

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* # Semantic UI 2.2.8 - Modal
2+
* # Semantic UI 2.2.10 - Modal
33
* http://github.com/semantic-org/semantic-ui/
44
*
55
*
@@ -103,10 +103,12 @@
103103
}
104104
.ui.modal > .image.content {
105105
display: -webkit-box;
106+
display: -webkit-flex;
106107
display: -ms-flexbox;
107108
display: flex;
108109
-webkit-box-orient: horizontal;
109110
-webkit-box-direction: normal;
111+
-webkit-flex-direction: row;
110112
-ms-flex-direction: row;
111113
flex-direction: row;
112114
}
@@ -115,43 +117,46 @@
115117
.ui.modal > .content > .image {
116118
display: block;
117119
-webkit-box-flex: 0;
120+
-webkit-flex: 0 1 auto;
118121
-ms-flex: 0 1 auto;
119122
flex: 0 1 auto;
120123
width: '';
121-
-ms-flex-item-align: top;
122-
-ms-grid-row-align: top;
123-
align-self: top;
124+
-webkit-align-self: top;
125+
-ms-flex-item-align: top;
126+
align-self: top;
124127
}
125128
.ui.modal > [class*="top aligned"] {
126-
-ms-flex-item-align: top;
127-
-ms-grid-row-align: top;
128-
align-self: top;
129+
-webkit-align-self: top;
130+
-ms-flex-item-align: top;
131+
align-self: top;
129132
}
130133
.ui.modal > [class*="middle aligned"] {
131-
-ms-flex-item-align: middle;
132-
-ms-grid-row-align: middle;
133-
align-self: middle;
134+
-webkit-align-self: middle;
135+
-ms-flex-item-align: middle;
136+
align-self: middle;
134137
}
135138
.ui.modal > [class*="stretched"] {
136-
-ms-flex-item-align: stretch;
137-
-ms-grid-row-align: stretch;
138-
align-self: stretch;
139+
-webkit-align-self: stretch;
140+
-ms-flex-item-align: stretch;
141+
align-self: stretch;
139142
}
140143

141144
/* Description */
142145
.ui.modal > .content > .description {
143146
display: block;
144147
-webkit-box-flex: 1;
148+
-webkit-flex: 1 0 auto;
145149
-ms-flex: 1 0 auto;
146150
flex: 1 0 auto;
147151
min-width: 0px;
148-
-ms-flex-item-align: top;
149-
-ms-grid-row-align: top;
150-
align-self: top;
152+
-webkit-align-self: top;
153+
-ms-flex-item-align: top;
154+
align-self: top;
151155
}
152156
.ui.modal > .content > .icon + .description,
153157
.ui.modal > .content > .image + .description {
154158
-webkit-box-flex: 0;
159+
-webkit-flex: 0 1 auto;
155160
-ms-flex: 0 1 auto;
156161
flex: 0 1 auto;
157162
min-width: '';
@@ -248,6 +253,7 @@
248253
.ui.modal .image.content {
249254
-webkit-box-orient: vertical;
250255
-webkit-box-direction: normal;
256+
-webkit-flex-direction: column;
251257
-ms-flex-direction: column;
252258
flex-direction: column;
253259
}

modal.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* # Semantic UI 2.2.8 - Modal
2+
* # Semantic UI 2.2.10 - Modal
33
* http://github.com/semantic-org/semantic-ui/
44
*
55
*
@@ -72,6 +72,8 @@ $.fn.modal = function(parameters) {
7272
element = this,
7373
instance = $module.data(moduleNamespace),
7474

75+
ignoreRepeatedEvents = false,
76+
7577
elementEventNamespace,
7678
id,
7779
observer,
@@ -226,18 +228,24 @@ $.fn.modal = function(parameters) {
226228

227229
event: {
228230
approve: function() {
229-
if(settings.onApprove.call(element, $(this)) === false) {
231+
if(ignoreRepeatedEvents || settings.onApprove.call(element, $(this)) === false) {
230232
module.verbose('Approve callback returned false cancelling hide');
231233
return;
232234
}
233-
module.hide();
235+
ignoreRepeatedEvents = true;
236+
module.hide(function() {
237+
ignoreRepeatedEvents = false;
238+
});
234239
},
235240
deny: function() {
236-
if(settings.onDeny.call(element, $(this)) === false) {
241+
if(ignoreRepeatedEvents || settings.onDeny.call(element, $(this)) === false) {
237242
module.verbose('Deny callback returned false cancelling hide');
238243
return;
239244
}
240-
module.hide();
245+
ignoreRepeatedEvents = true;
246+
module.hide(function() {
247+
ignoreRepeatedEvents = false;
248+
});
241249
},
242250
close: function() {
243251
module.hide();

modal.min.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)