This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2000 from cormacmccarthy/GH1994---keyboard-naviga…
…tion-of-open-empty-folder-in-tree Gh1994 keyboard navigation of open empty folder in tree should work as expected
- Loading branch information
Showing
12 changed files
with
306 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
define(function callCountModule () { | ||
return { | ||
data: [ | ||
{ | ||
'name': 'Convex and Concave', | ||
'type': 'item', | ||
'attr': { | ||
'id': 'item4' | ||
} | ||
} | ||
] | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
define(function emptyFolderModule () { | ||
return [ | ||
{ | ||
name: 'Empty Folder', | ||
type: 'folder', | ||
attr: { | ||
id: 'emptyFolder' | ||
}, | ||
children: [] | ||
}, | ||
{ | ||
name: 'Full Folder', | ||
type: 'folder', | ||
attr: { | ||
id: 'fullFolder' | ||
}, | ||
children: [ | ||
{ | ||
name: 'Empty Folder 2', | ||
type: 'folder', | ||
attr: { | ||
id: 'emptyFolder2' | ||
}, | ||
children: [] | ||
}, | ||
{ | ||
name: 'Folder Sibling 2', | ||
type: 'item', | ||
attr: { | ||
id: 'sibling2', | ||
'data-icon': 'glyphicon glyphicon-file' | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
name: 'Folder Sibling', | ||
type: 'item', | ||
attr: { | ||
id: 'sibling1', | ||
'data-icon': 'glyphicon glyphicon-file' | ||
} | ||
} | ||
]; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
define(function guidModule () { | ||
return function guid () { | ||
var s4 = function s4 () { | ||
return Math.floor((1 + Math.random()) * 0x10000) | ||
.toString(16) | ||
.substring(1); | ||
}; | ||
|
||
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
define(function textDataModule () { | ||
return { | ||
data: [ | ||
{ | ||
text: 'node text', | ||
type: 'folder', | ||
attr: { | ||
id: 'folder1' | ||
} | ||
} | ||
] | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
define(function treeDataModule (require) { | ||
var guid = require('./guid'); | ||
|
||
// make sure this returns a function so that new guids will be generated each time you use this data, otherwise | ||
// trees using this data to populate nested folders will not work because you will have duplicate IDs. ie: you | ||
// can't just return a static object here. You must return a function, and you must call that function again for | ||
// each use, you can't just cache and reuse the output. | ||
return function generateFreshData () { | ||
return { | ||
data: [ | ||
{ | ||
name: 'Ascending and Descending', | ||
type: 'folder', | ||
attr: { | ||
id: 'folder' + guid() | ||
} | ||
}, | ||
{ | ||
name: 'Sky and Water I (with custom icon)', | ||
type: 'item', | ||
attr: { | ||
id: 'folder' + guid(), | ||
'data-icon': 'glyphicon glyphicon-file' | ||
} | ||
}, | ||
{ | ||
name: 'Drawing Hands', | ||
type: 'folder', | ||
attr: { | ||
id: 'folder' + guid(), | ||
'data-children': false | ||
} | ||
}, | ||
{ | ||
name: 'Waterfall', | ||
type: 'item', | ||
attr: { | ||
id: 'item2' | ||
} | ||
}, | ||
{ | ||
name: 'Belvedere', | ||
type: 'folder', | ||
attr: { | ||
id: 'folder' + guid() | ||
} | ||
}, | ||
{ | ||
name: 'Relativity (with custom icon)', | ||
type: 'item', | ||
attr: { | ||
id: 'item3', | ||
'data-icon': 'glyphicon glyphicon-picture' | ||
} | ||
}, | ||
{ | ||
name: 'House of Stairs', | ||
type: 'folder', | ||
attr: { | ||
id: 'folder' + guid() | ||
} | ||
}, | ||
{ | ||
name: 'Convex and Concave', | ||
type: 'item', | ||
attr: { | ||
id: 'item4' | ||
} | ||
}, | ||
{ | ||
name: 'Load More', | ||
type: 'overflow', | ||
attr: { | ||
id: 'overflow1' | ||
} | ||
} | ||
] | ||
}; | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.