}, saveBookmarks: function () {
this.fluidbook.cache.set('bookmarks', this.bookmarks);
}, getSavedBookmarks: function () {
+ var res=[];
if (this.fluidbook.cache.isset('bookmarks')) {
- return this.fluidbook.cache.get('bookmarks');
+ res = this.fluidbook.cache.get('bookmarks');
+ if (res === undefined || res === null || res === 'undefined' || res === 'null' || res === '') {
+ res = [];
+ }
}
- return [];
+ return res;
}, isBookmarked: function (page) {
return this.areBookmarksAllowedOn(page) && this.bookmarks.indexOf(page) > -1;
}, areBookmarksAllowedOn: function (pageNr) {