this.resize = new FluidbookResize(this);
this.stats = new FluidbookStats(this);
this.stats.track(10);
+ this.flags = {};
this.initTheme();
this.initKeyboardShortcuts();
},
setMaxPage: function (p) {
- if (p === undefined) {
+ if (p === undefined || p <= 0) {
p = this.datas.pages;
}
if (this.currentPage > this.maxPage) {
this.setCurrentPage(this.maxPage);
} else {
- this.reloadCurrentPage();
+ //this.reloadCurrentPage();
}
this.hideUnnecessaryButtons();
resize();
}
return w;
- }
+ },
+
+ setFlag: function (name, value) {
+ if (value === undefined) {
+ value = true;
+ }
+ this.flags[name] = value;
+ },
+
+ hasFlag: function (name) {
+ return this.flags[name] === true;
+ },
+
+ hasFlags: function (names) {
+ var res = true;
+ var $this = this;
+ $.each(names, function (k, v) {
+ if ($this.hasFlag(v)) {
+ return;
+ }
+ res = false;
+ return true;
+ });
+ return res;
+ },
}