Created
June 13, 2014 18:24
-
-
Save lakenen/16136477a57c84eff224 to your computer and use it in GitHub Desktop.
Presentation layout that zooms like a vertical layout for viewer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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