Skip to content

Commit e41d12b

Browse files
Arjun KannanArjun Kannan
authored andcommitted
Don;t include element type when using unique identifier - easier to resolve when dom changes
1 parent ee937a3 commit e41d12b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

dist/js/jQueryGetPath.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* globals jQuery */
22
jQuery.fn.extend({
3-
getPath: function(){
3+
getPath: function () {
44
"use strict";
55
var path;
66
var node = this;
@@ -19,7 +19,7 @@ jQuery.fn.extend({
1919
var tag = uniqueTags[i];
2020
var tagValue = node.attr(tag);
2121
if (tagValue && (tagValue.trim !== '')) {
22-
name += '[' + tag + '=\"' + tagValue + '\"]';
22+
name = '[' + tag + '=\"' + tagValue + '\"]';
2323
//we've found a unique identifier so we're done
2424
uniqueIdentifierFound = true;
2525
break; //exit for loop

src/js/jQueryGetPath.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* globals jQuery */
22
jQuery.fn.extend({
3-
getPath: function(){
3+
getPath: function () {
44
"use strict";
55
var path;
66
var node = this;
@@ -19,7 +19,7 @@ jQuery.fn.extend({
1919
var tag = uniqueTags[i];
2020
var tagValue = node.attr(tag);
2121
if (tagValue && (tagValue.trim !== '')) {
22-
name += '[' + tag + '=\"' + tagValue + '\"]';
22+
name = '[' + tag + '=\"' + tagValue + '\"]';
2323
//we've found a unique identifier so we're done
2424
uniqueIdentifierFound = true;
2525
break; //exit for loop

0 commit comments

Comments
 (0)