Skip to content

Commit

Permalink
Fixed a bug w the getTag() helper method. If the first child was a co…
Browse files Browse the repository at this point in the history
…mment node, it returned a tagname of 'undefined'
  • Loading branch information
Sean Jezewski committed Sep 29, 2011
1 parent 06a4a9b commit 81d916f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="stylesheet" href="../packages/qunit/qunit/qunit.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script src="../packages/qunit/qunit/qunit.js" type="text/javascript" charset="utf-8"></script>
<!-- make sure you include the proper build of XUI -->
<script src="../lib/xui-2.2.0.js" type="text/javascript" charset="utf-8"></script>
<script src="../lib/xui-2.2.1.js" type="text/javascript" charset="utf-8"></script>
<script src="tests/core-tests.js" type="text/javascript"></script>
<style>
h2#qunit-banner {
Expand Down
2 changes: 1 addition & 1 deletion src/js/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ xui.extend({
});
// private method for finding a dom element
function getTag(el) {
return (el.firstChild === null) ? {'UL':'LI','DL':'DT','TR':'TD'}[el.tagName] || el.tagName : el.firstChild.tagName;
return (el.children[0] === undefined) ? {'UL':'LI','DL':'DT','TR':'TD'}[el.tagName] || el.tagName : el.children[0].tagName;
}

function wrapHelper(html, el) {
Expand Down

0 comments on commit 81d916f

Please sign in to comment.