diff options
Diffstat (limited to 'assets/javascripts/bootstrap/modal.js')
-rw-r--r-- | assets/javascripts/bootstrap/modal.js | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/assets/javascripts/bootstrap/modal.js b/assets/javascripts/bootstrap/modal.js index 6be03d1..da13eb2 100644 --- a/assets/javascripts/bootstrap/modal.js +++ b/assets/javascripts/bootstrap/modal.js @@ -1,13 +1,13 @@ /*! - * Bootstrap modal.js v4.2.1 (https://getbootstrap.com/) - * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Bootstrap modal.js v4.3.0 (https://getbootstrap.com/) + * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) : typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) : - (global.Modal = factory(global.jQuery,global.Util)); -}(this, (function ($,Util) { 'use strict'; + (global = global || self, global.Modal = factory(global.jQuery, global.Util)); +}(this, function ($, Util) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util; @@ -69,7 +69,7 @@ */ var NAME = 'modal'; - var VERSION = '4.2.1'; + var VERSION = '4.3.0'; var DATA_KEY = 'bs.modal'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -102,6 +102,7 @@ CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY }; var ClassName = { + SCROLLABLE: 'modal-dialog-scrollable', SCROLLBAR_MEASURER: 'modal-scrollbar-measure', BACKDROP: 'modal-backdrop', OPEN: 'modal-open', @@ -110,6 +111,7 @@ }; var Selector = { DIALOG: '.modal-dialog', + MODAL_BODY: '.modal-body', DATA_TOGGLE: '[data-toggle="modal"]', DATA_DISMISS: '[data-dismiss="modal"]', FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', @@ -262,8 +264,8 @@ _proto.handleUpdate = function handleUpdate() { this._adjustDialog(); - }; // Private - + } // Private + ; _proto._getConfig = function _getConfig(config) { config = _objectSpread({}, Default, config); @@ -287,7 +289,11 @@ this._element.setAttribute('aria-modal', true); - this._element.scrollTop = 0; + if ($(this._dialog).hasClass(ClassName.SCROLLABLE)) { + this._dialog.querySelector(Selector.MODAL_BODY).scrollTop = 0; + } else { + this._element.scrollTop = 0; + } if (transition) { Util.reflow(this._element); @@ -457,11 +463,11 @@ } else if (callback) { callback(); } - }; // ---------------------------------------------------------------------- + } // ---------------------------------------------------------------------- // the following methods are used to handle overflowing modals // todo (fat): these should probably be refactored out of modal.js // ---------------------------------------------------------------------- - + ; _proto._adjustDialog = function _adjustDialog() { var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; @@ -546,8 +552,8 @@ var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); return scrollbarWidth; - }; // Static - + } // Static + ; Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { return this.each(function () { @@ -640,4 +646,4 @@ return Modal; -}))); +})); |