Skip to content

Commit

Permalink
fix: "-" symbol in id
Browse files Browse the repository at this point in the history
  • Loading branch information
maxazan committed Dec 16, 2013
1 parent 9278ac8 commit 804a1f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
== 0.1.8 - 16 December 2013
* Fix support alphanumeric id (you can use "-" symbol in id)

== 0.1.7 - 15 November 2013
* Fix isLast method. https://github.com/maxazan/jquery-treegrid/issues/4
* Add isFirst method
Expand Down
12 changes: 6 additions & 6 deletions js/jquery.treegrid.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery treegrid Plugin 0.1.7
* jQuery treegrid Plugin 0.1.8
* https://github.com/maxazan/jquery-treegrid
*
* Copyright 2013, Pomazan Max
Expand Down Expand Up @@ -516,14 +516,14 @@
return $(this).find('.treegrid-expander');
},
getNodeId: function() {
var template = /treegrid-(\w+)/;
var template = /treegrid-([A-Za-z0-9_-]+)/;
if (template.test($(this).attr('class'))) {
return template.exec($(this).attr('class'))[1];
}
return null;
},
getParentNodeId: function() {
var template = /treegrid-parent-(\w+)/;
var template = /treegrid-parent-([A-Za-z0-9_-]+)/;
if (template.test($(this).attr('class'))) {
return template.exec($(this).attr('class'))[1];
}
Expand All @@ -543,16 +543,16 @@
getRootNodes: function(treegridContainer) {
var result = $.grep(treegridContainer.find('tr'), function(element) {
var classNames = $(element).attr('class');
var templateClass = /treegrid-(\w+)/;
var templateParentClass = /treegrid-parent-(\w+)/;
var templateClass = /treegrid-([A-Za-z0-9_-]+)/;
var templateParentClass = /treegrid-parent-([A-Za-z0-9_-]+)/;
return templateClass.test(classNames) && !templateParentClass.test(classNames);
});
return $(result);
},
getAllNodes: function(treegridContainer) {
var result = $.grep(treegridContainer.find('tr'), function(element) {
var classNames = $(element).attr('class');
var templateClass = /treegrid-(\w+)/;
var templateClass = /treegrid-([A-Za-z0-9_-]+)/;
return templateClass.test(classNames);
});
return $(result);
Expand Down
2 changes: 1 addition & 1 deletion treegrid.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"tree",
"ui"
],
"version": "0.1.7",
"version": "0.1.8",
"title": "TreeGrid plugin for jQuery",
"author": {
"name": "Pomazan Max"
Expand Down

0 comments on commit 804a1f7

Please sign in to comment.