Skip to content

Commit

Permalink
#3396 modal close
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Feb 20, 2018
1 parent c2d19b0 commit aa33138
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
5 changes: 3 additions & 2 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
**Minor Enhancements**
- **Theming** - Added global variables for reassigning `normal` and `bold` font weights for custom font stacks. **Thanks @jaridmargolin** #6167
- **Search** - Category results now has `exact` setting matching dropdown for `fullTextSearch` preventing fuzzy search

**Other Enhancements**
- **Search** - Category results will now responsively adjust `title` row if titles are long instead of forcing a title width
- **Dimmer** - Dimmers now have centered content with a single wrapping `content` element.
- **Popup** - Popup will now align the center of the arrow (not the edge of the popup) when it would be reasonable (up to 2x arrow's offset from edge). [See this explanation](http://oi66.tinypic.com/2zr2ckk.jpg)
- **Popup** - Popup can now position elements correctly even when they have a different offset context than their activating element. Like in [this example](https://jsfiddle.net/g853mc03/)
- **Modal** - You can now modify `closable` setting after init **Thanks @mdehoog** #3396

**Tiny Enhancements**
- **Popup** - `arrowBackground` now inherits from `background` #6059 **Thanks @devsli**
- **Popup** - Adds new variable `headerFontWeight`

Expand Down
23 changes: 10 additions & 13 deletions src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,26 +241,23 @@ $.fn.modal = function(parameters) {
module.hide();
},
click: function(event) {
if(!settings.closable) {
module.verbose('Dimmer clicked but closable setting is disabled');
return;
}
var
$target = $(event.target),
isInModal = ($target.closest(selector.modal).length > 0),
isInDOM = $.contains(document.documentElement, event.target)
;
if(!isInModal && isInDOM) {
if(settings.closable) {
module.debug('Dimmer clicked, hiding all modals');
if( module.is.active() ) {
module.remove.clickaway();
if(settings.allowMultiple) {
module.hide();
}
else {
module.hideAll();
}
}
if(!isInModal && isInDOM && module.is.active()) {
module.debug('Dimmer clicked, hiding all modals');
module.remove.clickaway();
if(settings.allowMultiple) {
module.hide();
}
else {
module.debug('Dimmer clicked, but closable is set to false');
module.hideAll();
}
}
},
Expand Down

0 comments on commit aa33138

Please sign in to comment.