Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Add refreshFolder method to tree #1591

Merged
merged 1 commit into from
Nov 3, 2015

Conversation

interactivellama
Copy link
Contributor

  • Add refreshFolder method in order to bust "DOM cached" folder children and reload from dataSource.
  • Unit test makes sure that different nodes are present after refresh by using random numbers on id.

Fixes #1592.

UI pattern update

  • This assumes that refreshFolder is a background process, not something initiated by the user-- therefore "Loading..." will not display when folder is refreshed when closed.
  • Developers can use the `refreshedFolder.fu.tree" event to dismiss user feedback if they wish to.
  • A folder will show "Loading..." when folder is currently open for the user, due to the "broken looking" state that would be displayed if "Loading..." was not present when the "folder children disappear" while requesting data from the server.

@jamin-hall Might want to check on this when you return.

Side note: We may want to wait until the data is loaded from the server to actually empty out the folder if "loading..." is not present (this would remove the "broken state" possibility.

var $treebranch = $el.closest('.tree-branch');
var $refreshedBranch;
$treebranch.find('.tree-branch-children').eq(0).empty();
$refreshedBranch = this._discloseFolder($el.find('.tree-branch-header'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to actually open the folder. Just need to refresh the content in the folder. so just empty and run populate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to force open because of our "Loading..." pattern.

- adds isBackgroundProcess parameter to populate
swilliamset added a commit that referenced this pull request Nov 3, 2015
@swilliamset swilliamset merged commit a765c52 into ExactTarget:master Nov 3, 2015
@interactivellama interactivellama deleted the tree-refresh branch April 4, 2016 15:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add refreshFolder method to tree
2 participants