FluidbookZoom.prototype = {
init: function () {
+ var $this=this;
this.setTransition(true);
+
+ $(this.fluidbook).on('fluidbook.zoom.out.end', function () {
+ $("#z").addClass('nozoom');
+ });
+
+ // Detect when we have finished zooming out and raise an event
+ $("#z").on('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function () {
+ $this.triggerEvent((($this.zoom == 1) ? 'out' : 'in') + '.end');
+ });
+
+ },
+
+ triggerEvent: function (event) {
+ console.log('trigger ' + e);
+ $(this.fluidbook).trigger(e);
},
/**
} else {
$("header,footer,#interface").removeClass('hidden');
}
- $("#z").addClass('animate').transform(animation);
- setTimeout(function () {
- $("#z").removeClass('animate');
- if (this.zoom == 1) {
- $("#z").addClass('nozoom');
- }
- }, 600);
+ $("#z").transform(animation);
+ $this.triggerEvent(((this.zoom == 1) ? 'out' : 'in') + '.start');
+ if (!this.transition) {
+ $this.triggerEvent(((this.zoom == 1) ? 'out' : 'in') + '.end');
+ }
if (this.desktopScale > 1) {
$("body").addClass('zoomed');