Browse Source

#3396 modal close

pull/5282/merge
Jack 6 years ago
parent
commit
aa331386d0
2 changed files with 13 additions and 15 deletions
  1. 5
      RELEASE-NOTES.md
  2. 23
      src/definitions/modules/modal.js

5
RELEASE-NOTES.md

@ -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`

23
src/definitions/modules/modal.js

@ -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();
}
}
},

Loading…
Cancel
Save