Hi
Analogus,
there are three ways to do that
1) "subscribe" to an appropriate event
2) "hook" a appropriate function
like it is done in ViewerSettings.js
Code:
Core.events.subscribe(Core.events.EVENTS.BOOK_CHANGED, resetMarginCut);
Core.hook.hookAfter(ebook, "rotate", rotateMarginCut); //function(where, what, newFunction, tag)
where the first event may be usefull for your purpose,
the second line is just to show the principle.
To find events and functions check kbook.xs
3) hook a function manually, by totally or partially rewriting it in your code.
It often looks like this:
Code:
var oldfunc;
oldfunc = kbook.some.function;
kbook.some.function = function () {
...
do something
...
oldfunc.apply(this, arguments);
}
You can find plenty of these in PRS+ code.
HTH
Mark