diff options
| author | Johann-S <[email protected]> | 2017-09-03 13:00:10 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-09-03 13:00:10 +0200 |
| commit | 900da3e235305c2daefe86c0a960e36be6e1b60b (patch) | |
| tree | a4c5d188bf8416fe7b801fbac79a2ad21af7012e /js/tests | |
| parent | 2e5f1e22860a892f5abdbb65abc14172e0129c1a (diff) | |
| parent | e04e42d08c059732153ff6925fa712464cf12207 (diff) | |
| download | bootstrap-900da3e235305c2daefe86c0a960e36be6e1b60b.tar.xz bootstrap-900da3e235305c2daefe86c0a960e36be6e1b60b.zip | |
Merge pull request #23732 from techdavid/fix-jumping-modal-on-resize
Fix jumping modal when the viewport is resized
Diffstat (limited to 'js/tests')
| -rw-r--r-- | js/tests/unit/modal.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index 735dc4f0c..e026cd7f1 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -351,6 +351,20 @@ $(function () { $toggleBtn.trigger('click') }) + QUnit.test('should adjust the inline padding of the modal when opening', function (assert) { + assert.expect(1) + var done = assert.async() + + $('<div id="modal-test"/>') + .on('shown.bs.modal', function () { + var expectedPadding = $(this).getScrollbarWidth() + 'px' + var currentPadding = $(this).css('padding-right') + assert.strictEqual(currentPadding, expectedPadding, 'modal padding should be adjusted while opening') + done() + }) + .bootstrapModal('show') + }) + QUnit.test('should adjust the inline body padding when opening and restore when closing', function (assert) { assert.expect(2) var done = assert.async() |
