diff --git a/.gitignore b/.gitignore index 6b72413587..2215d636ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ # Ignore docs files /_site/ -# Hugo folders +# Hugo files /resources/ +/.hugo_build.lock # Numerous always-ignore extensions *.diff diff --git a/js/src/tab.js b/js/src/tab.js index 85f2f2ebc1..9c2e22d088 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -58,7 +58,8 @@ class Tab { if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(CLASS_NAME_ACTIVE) || - $(this._element).hasClass(CLASS_NAME_DISABLED)) { + $(this._element).hasClass(CLASS_NAME_DISABLED) || + this._element.hasAttribute('disabled')) { return } diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 9ede231c5b..8f80a00c84 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -44,14 +44,30 @@ $(function () { assert.strictEqual($tab[0], $el[0], 'collection contains element') }) - QUnit.test('should activate element by tab id', function (assert) { + QUnit.test('should activate element by tab id (using buttons, the preferred semantic way)', function (assert) { assert.expect(2) - var tabsHTML = '