From c8ef917f9afa4ab5911b5a756ea08dec735d539c Mon Sep 17 00:00:00 2001 From: Christopher McCulloh Date: Sat, 24 Jun 2017 14:12:38 -0400 Subject: [PATCH] (GH1994) cleans up staticDataTree.html a bit. Can be used for testing arrow functionality on tree --- dev/staticDataTree.html | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/dev/staticDataTree.html b/dev/staticDataTree.html index 5179776b..78338c3f 100644 --- a/dev/staticDataTree.html +++ b/dev/staticDataTree.html @@ -28,10 +28,10 @@
-

Tree

+

Static Data Tree

-

folders selectable (please note structure of treebranch)

+

This file is useful for testing static data tree & keyboard navigation on tree

@@ -127,6 +127,14 @@ } ] }, + { + name: 'Empty Folder', + type: 'folder', + attr: { + id: 'emptyFolder' + }, + children: [] + }, { name: 'Folder Sibling', type: 'item', @@ -139,30 +147,8 @@ var $tree = $('#myTree'); - $tree.one('populated.fu.tree', function triggerDiscloseFolder () { - var $initialBranch = $($tree.find('li:not(".hidden"):first')); -// // var $nextBranch = $($tree.find('li:not(".hidden")').get(1)); -console.log('in populated', $initialBranch); -// $tree.on('disclosedFolder.fu.tree', function triggerDownArrow () { -// $initialBranch.attr('tabindex', 0); -// $initialBranch.focus(); -// console.log('in disclosed'); -// $tree.on('keyboardNavigated.fu.tree', function testDownArrowResult () { -// // assert.equal($(document.activeElement).attr('id'), $nextBranch.attr('id'), 'next sibling now has focus'); -// console.log('complete'); -// }); - -// // assert.equal($(document.activeElement).attr('id'), $initialBranch.attr('id'), 'initial branch has focus'); - -// // var pressDownArrow = this.getKeyDown('down', $initialBranch); -// // $initialBranch.trigger(pressDownArrow); -// }); -// console.log('trigger disclosure', $initialBranch); - window.setTimeout(function() {$tree.tree('discloseFolder', $initialBranch);}, 1); - }); - $tree.tree({ - data: staticData + staticData: staticData }); }); })();