diff options
author | Heinrich Fenkart <hnrch02@gmail.com> | 2014-11-12 23:29:14 +0300 |
---|---|---|
committer | Heinrich Fenkart <hnrch02@gmail.com> | 2014-11-12 23:29:14 +0300 |
commit | 6dd6777cf2ac215beea686d0b7b4c7fe0f90d989 (patch) | |
tree | e0d411fba47c31d894ebbf1c63d546caca631247 /dist | |
parent | df507dca8e943f46960fc3a0d0fc8c061b8fe41b (diff) |
E034: Fix firing when `.close` button is not preceded by anything
Fixes #181.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/browser/bootlint.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dist/browser/bootlint.js b/dist/browser/bootlint.js index 93c660c..3149358 100644 --- a/dist/browser/bootlint.js +++ b/dist/browser/bootlint.js @@ -11039,7 +11039,9 @@ var LocationIndex = _location.LocationIndex; addLinter("E034", function lintAlertDismissStructure($, reporter) { var nonFirstChildCloses = $('.alert>.close:not(:first-child)'); var closesPrecededByText = $('.alert>.close').filter(function () { - return !!($(this).parent().contents().eq(0).text().trim()); + var firstNode = $(this).parent().contents().eq(0); + var firstNodeIsText = IN_NODE_JS ? firstNode[0].type === 'text' : firstNode[0].nodeType === 3; + return !!(firstNodeIsText && firstNode.text().trim()); }); var problematicCloses = nonFirstChildCloses.add(closesPrecededByText); if (problematicCloses.length) { |