diff options
author | Mark Otto <markdotto@gmail.com> | 2018-01-12 09:42:40 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2018-01-12 09:42:40 +0300 |
commit | 6d8d8639f3a290cba93ef406c59ea31ad46e1c6d (patch) | |
tree | afef6ae26f246839effeb0fe894bab25075c7418 /js/dist/util.js | |
parent | 80d0943b95984bfaf4997d2198d467876d294bd8 (diff) |
dist
Diffstat (limited to 'js/dist/util.js')
-rw-r--r-- | js/dist/util.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/dist/util.js b/js/dist/util.js index f827138523..ac31fc87d0 100644 --- a/js/dist/util.js +++ b/js/dist/util.js @@ -11,7 +11,7 @@ var Util = function ($) { * ------------------------------------------------------------------------ */ var transition = false; - var MAX_UID = 1000000; // shoutout AngusCroll (https://goo.gl/pxwQGp) + var MAX_UID = 1000000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) function toType(obj) { return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); @@ -32,7 +32,7 @@ var Util = function ($) { } function transitionEndTest() { - if (window.QUnit) { + if (typeof window !== 'undefined' && window.QUnit) { return false; } @@ -66,7 +66,7 @@ var Util = function ($) { } function escapeId(selector) { - // we escape IDs in case of special selectors (selector = '#myId:something') + // We escape IDs in case of special selectors (selector = '#myId:something') // $.escapeSelector does not exist in jQuery < 3 selector = typeof $.escapeSelector === 'function' ? $.escapeSelector(selector).substr(1) : selector.replace(/(:|\.|\[|\]|,|=|@)/g, '\\$1'); return selector; @@ -93,7 +93,7 @@ var Util = function ($) { if (!selector || selector === '#') { selector = element.getAttribute('href') || ''; - } // if it's an ID + } // If it's an ID if (selector.charAt(0) === '#') { @@ -103,7 +103,7 @@ var Util = function ($) { try { var $selector = $(document).find(selector); return $selector.length > 0 ? selector : null; - } catch (error) { + } catch (err) { return null; } }, |