Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jkirkell/2054fd137afe39709b31 to your computer and use it in GitHub Desktop.
Save jkirkell/2054fd137afe39709b31 to your computer and use it in GitHub Desktop.
/**
* @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