Namespace: FileBrowserViewModel

Member Of Namespace: clbFileBrowser

Description

ViewModel of the clbFileBrowser directive. This instance is accessible by all direct children of the file browser.

It is responsible to handle all the interactions between the user and the services. It does not update the views directly but sends the relevant events when necessary.

Function: handleFocus

When the user focus on a browser item, emit a ‘clbFileBrowser:focusChanged’ event.

The event signature is (event, newEntity, previousEntity).

handleFocus(entity)
Arguments:
  • entity (Object) – selected entity

Function: handleNavigation

When the current context change, trigger a navigation update.

This will render the view for the new current entity. All navigations are chained to ensure that the future view will end in a consistant state. As multiple requests are needed to render a view, request result would sometimes finish after a new navigation event already occured.

handleNavigation(entity)
Arguments:
  • entity (Object) – the new current entity
Return promise:

resolve when the navigation is done.

Function: loadMoreFiles

Load the next page of file entities for the current entity.

loadMoreFiles()
Return Promise:resolve when the files are loaded

Function: loadMoreFolders

Load the next page of folder entities for the current entity.

loadMoreFolders()
Return Promise:resolve when the folders are loaded