Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lakenen/16136477a57c84eff224 to your computer and use it in GitHub Desktop.
Save lakenen/16136477a57c84eff224 to your computer and use it in GitHub Desktop.
Presentation layout that zooms like a vertical layout for viewer.js
/**
* @fileoverview layout-presentation-vertical component definition
* @author lakenen
*/
(function () {
var componentName = 'layout-presentation-vertical';
var mixins = [
'layout-' + Crocodoc.LAYOUT_PRESENTATION,
'layout-' + Crocodoc.LAYOUT_VERTICAL
];
// create a new layout component that requests presentation and vertical layouts as mixins
Crocodoc.addComponent(componentName, mixins, function (scope, presentation, vertical) {
// extend presentation layout with some custom functionality
return presentation.extend({
// initialize the layout
init: function () {
var config = scope.getConfig();
// reset the layout name to 'presentation'
config.layout = Crocodoc.LAYOUT_PRESENTATION;
presentation.init.call(this);
},
// override calculateZoomAutoValue behavior to match that of layout 'vertical'
calculateZoomAutoValue: vertical.calculateZoomAutoValue
}));
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment