diff options
author | Andrew Luca <thendrluca@gmail.com> | 2018-10-21 13:15:35 +0300 |
---|---|---|
committer | Johann-S <johann.servoire@gmail.com> | 2018-10-21 18:45:02 +0300 |
commit | 1f1308ba22ee601744f7f71df712bc4a018b8a0a (patch) | |
tree | fa7734e209317f6e2a1dacb2dd25bfaf2cea565e /js | |
parent | ff9b195da7acb6f1aaab50a5507d2f663ebab31a (diff) |
test(Modal): reuse _getScrollbarWidth in tests
Diffstat (limited to 'js')
-rw-r--r-- | js/tests/unit/modal.js | 9 |
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') |