Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New: Allow BoxAnnotations to be passed in as a Preview option #539

Merged
merged 4 commits into from
Dec 11, 2017

Conversation

pramodsum
Copy link
Contributor

@pramodsum pramodsum commented Dec 11, 2017

This change combined with box/box-annotations#68 will allow a developer to instantiate annotations outside of Preview like this:

const options = {
    Image: {
        enabled: true
    },

    // Document/Presentation Annotators are the same so the config is simplified here
    Document: {
        enabledTypes: ['highlight', 'draw']
    }
};


/* global BoxAnnotations */
const boxAnnotations = new BoxAnnotations(options);

var preview = new Box.Preview();
preview.show(FILE_ID, ACCESS_TOKEN, {
    container: '.preview-container',
    showDownload: true,
    boxAnnotations
});

@boxcla
Copy link

boxcla commented Dec 11, 2017

Verified that @pramodsum has signed the CLA. Thanks for the pull request!

@@ -755,13 +764,21 @@ class BaseViewer extends EventEmitter {
*/
areAnnotationsEnabled() {
// Respect viewer-specific annotation option if it is set
// #TODO(@spramod|@jholdstock): remove this after we have annotation instancing
Copy link
Contributor Author

@pramodsum pramodsum Dec 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pramodsum pramodsum merged commit e3281cf into box:master Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants