Index: jquery.treeTable.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/jquery.treeTable.css,v
retrieving revision 1.2
diff -u -p -r1.2 jquery.treeTable.css
--- jquery.treeTable.css 10 Jul 2010 13:57:47 -0000 1.2
+++ jquery.treeTable.css 24 Sep 2010 22:15:35 -0000
@@ -24,6 +24,10 @@
background-image: url(arrow-down.png);
}
+.treeTable tr td a.expander:focus {
+ font-weight: bold;
+}
+
/* jquery.treeTable.sortable
* ------------------------------------------------------------------------- */
.treeTable tr.selected, .treeTable tr.accept {
Index: jquery.treeTable.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/jquery.treeTable.js,v
retrieving revision 1.1
diff -u -p -r1.1 jquery.treeTable.js
--- jquery.treeTable.js 16 Mar 2010 23:48:58 -0000 1.1
+++ jquery.treeTable.js 24 Sep 2010 22:15:35 -0000
@@ -42,7 +42,9 @@
expandable: true,
indent: 19,
initialState: "collapsed",
- treeColumn: 0
+ treeColumn: 0,
+ stringExpand: "Expand",
+ stringCollapse: "Collapse"
};
// Recursively hide all node's children in a tree
@@ -124,7 +126,9 @@
$.fn.toggleBranch = function() {
if($(this).hasClass("collapsed")) {
$(this).expand();
+ $(this).children('td:first-child').children('a:first-child').attr('title', options.stringCollapse);
} else {
+ $(this).children('td:first-child').children('a:first-child').attr('title', options.stringExpand);
$(this).removeClass("expanded").collapse();
}
@@ -178,8 +182,9 @@
});
if(options.expandable) {
- cell.prepend('');
- $(cell[0].firstChild).click(function() { node.toggleBranch(); });
+ cell.wrapInner('');
+ $(cell[0].firstChild).click(function() { node.toggleBranch(); return false; });
+ $(cell[0].firstChild).keydown(function(e) { if(e.keyCode == 13) {node.toggleBranch(); return false; }});
if(options.clickableNodeNames) {
cell[0].style.cursor = "pointer";
Index: token.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/token.js,v
retrieving revision 1.3
diff -u -p -r1.3 token.js
--- token.js 20 Mar 2010 19:48:25 -0000 1.3
+++ token.js 24 Sep 2010 22:15:35 -0000
@@ -5,7 +5,11 @@
Drupal.behaviors.tokenTree = {
attach: function (context, settings) {
$('table.token-tree', context).once('token-tree', function () {
- $(this).treeTable();
+ opts = {
+ stringCollapse: Drupal.t('Collapse'),
+ stringExpand: Drupal.t('Expand')
+ };
+ $(this).treeTable(opts);
});
}
};