2 * Favorites management.
4 Ext.define("Docs.Favorites", {
5 extend: 'Docs.LocalStore',
6 storeName: 'Favorites',
10 * Associates Favorites with Docs TreePanel component.
11 * @param {Docs.view.tree.Tree} tree
13 setTree: function(tree) {
18 * Adds class to favorites
20 * @param {String} cls the class to add
24 this.store.add({cls: cls});
26 this.tree.setFavorite(cls, true);
31 * Removes class from favorites.
33 * @param {String} cls the class to remove
35 remove: function(cls) {
37 this.store.removeAt(this.store.findExact('cls', cls));
39 this.tree.setFavorite(cls, false);
44 * Checks if class is in favorites
46 * @param {String} cls the classname to check
47 * @return {Boolean} true when class exists in favorites.
50 return this.store.findExact('cls', cls) > -1;