Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Luca <thendrluca@gmail.com>2018-10-21 13:15:35 +0300
committerJohann-S <johann.servoire@gmail.com>2018-10-21 18:45:02 +0300
commit1f1308ba22ee601744f7f71df712bc4a018b8a0a (patch)
treefa7734e209317f6e2a1dacb2dd25bfaf2cea565e /js
parentff9b195da7acb6f1aaab50a5507d2f663ebab31a (diff)
test(Modal): reuse _getScrollbarWidth in tests
Diffstat (limited to 'js')
-rw-r--r--js/tests/unit/modal.js9
1 files changed, 1 insertions, 8 deletions
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js
index 914366ae22..c8f247a350 100644
--- a/js/tests/unit/modal.js
+++ b/js/tests/unit/modal.js
@@ -13,14 +13,7 @@ $(function () {
// Enable the scrollbar measurer
$('<style type="text/css"> .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } </style>').appendTo('head')
// Function to calculate the scrollbar width which is then compared to the padding or margin changes
- $.fn.getScrollbarWidth = function () {
- var scrollDiv = document.createElement('div')
- scrollDiv.className = 'modal-scrollbar-measure'
- document.body.appendChild(scrollDiv)
- var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
- document.body.removeChild(scrollDiv)
- return scrollbarWidth
- }
+ $.fn.getScrollbarWidth = $.fn.modal.Constructor.prototype._getScrollbarWidth
// Simulate scrollbars
$('html').css('padding-right', '16px')