Class: BookmarkManager

Cadcorp.UI.BookmarkManager

new BookmarkManager(config)

Manages getting and setting bookmarks
Parameters:
Name Type Description
config Object Configuration for this object. The config supplied directly extends the control

Members

events

Properties:
Name Type Description
events Cadcorp.Util.Events The events object

Methods

addBookmark(newBookmark)

Adds a user created bookmark. If the newBookmark.name already exists in this manager the existing bookmark is overwritten
Parameters:
Name Type Description
newBookmark Cadcorp.UI.Bookmark The new bookmark to add to this manager
Fires:

destroy()

Destroys this object

getBookmark(bookmarkToGet) → {Cadcorp.UI.Bookmark|null}

Gets a bookmark.
Parameters:
Name Type Description
bookmarkToGet string The name of the bookmark to look up
Returns:
The found bookmark or null if not found
Type
Cadcorp.UI.Bookmark | null

getHomeLocation() → {Cadcorp.UI.Bookmark|null}

Gets the bookmark whose isHomeLocation is true
Returns:
The bookmark or null
Type
Cadcorp.UI.Bookmark | null

recallUserBookmarks()

Gets all the bookmarks stored as cookies

removeAllUserBookmarks()

Removes all user created bookmarks. Fires the bookmarkRemoved event for each bookmark removed. Fires allBookmarksRemoved after all bookmarks have been removed
Fires:

removeBookmark(bookmarkToRemove)

Removes a bookmark.
Parameters:
Name Type Description
bookmarkToRemove string The name of the bookmark to remove
Fires:

setHomeLocation()

Sets the isHomeLocation for each bookmark to false

storeUserBookmarks()

Stores all user created bookmarks in the cookies. Only stores the cookies if the user has consented to cookies being used

Events

allBookmarksRemoved

All bookmarks removed event
Type:
  • Object
Properties:
Name Type Description
object Cadcorp.UI.BookmarkManager The sender of the event

bookmarkAdded

Bookmark added event
Type:
  • Object
Properties:
Name Type Description
object Cadcorp.UI.BookmarkManager The sender of the event
bookmark Cadcorp.UI.Bookmark The bookmark that was added

bookmarkRemoved

Bookmark removed event
Type:
  • Object
Properties:
Name Type Description
object Cadcorp.UI.BookmarkManager The sender of the event
bookmark Cadcorp.UI.Bookmark The bookmark that was removed