From 699ed56640ce3d44f98dd5858955e89ec45be9f2 Mon Sep 17 00:00:00 2001 From: Sumedha Pramod Date: Tue, 9 May 2017 16:30:23 -0700 Subject: [PATCH] Chore: Bundling annotations.css separately from preview.css (#106) --- src/lib/annotations/Annotator.js | 1 + src/lib/viewers/BaseViewer.js | 3 ++- src/lib/viewers/doc/Document.scss | 1 - src/lib/viewers/doc/Presentation.scss | 1 - src/lib/viewers/image/Image.scss | 2 -- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/annotations/Annotator.js b/src/lib/annotations/Annotator.js index 0f582720c..1f13765b7 100644 --- a/src/lib/annotations/Annotator.js +++ b/src/lib/annotations/Annotator.js @@ -4,6 +4,7 @@ import Notification from '../Notification'; import AnnotationService from './AnnotationService'; import * as constants from './annotationConstants'; import { CLASS_ACTIVE } from '../constants'; +import './Annotator.scss'; @autobind class Annotator extends EventEmitter { diff --git a/src/lib/viewers/BaseViewer.js b/src/lib/viewers/BaseViewer.js index 9eb06bd71..ea93bf283 100644 --- a/src/lib/viewers/BaseViewer.js +++ b/src/lib/viewers/BaseViewer.js @@ -26,6 +26,7 @@ import { } from '../constants'; const ANNOTATIONS_JS = ['annotations.js']; +const ANNOTATIONS_CSS = ['annotations.css']; const LOAD_TIMEOUT_MS = 180000; // 3m const RESIZE_WAIT_TIME_IN_MILLIS = 300; @@ -74,7 +75,7 @@ class BaseViewer extends EventEmitter { // the assets are available, the showAnnotations flag is true, and the // expiring embed is not a shared link if (this.areAnnotationsEnabled() && !this.options.sharedLink) { - this.loadAssets(ANNOTATIONS_JS); + this.loadAssets(ANNOTATIONS_JS, ANNOTATIONS_CSS); } } diff --git a/src/lib/viewers/doc/Document.scss b/src/lib/viewers/doc/Document.scss index 9df8a5fb0..679317a16 100644 --- a/src/lib/viewers/doc/Document.scss +++ b/src/lib/viewers/doc/Document.scss @@ -1,4 +1,3 @@ -@import '../../annotations/Annotator'; @import 'docBase'; @import './DocFindBar'; diff --git a/src/lib/viewers/doc/Presentation.scss b/src/lib/viewers/doc/Presentation.scss index 835f6244a..9ae56ffb7 100644 --- a/src/lib/viewers/doc/Presentation.scss +++ b/src/lib/viewers/doc/Presentation.scss @@ -1,4 +1,3 @@ -@import '../../annotations/Annotator'; @import 'docBase'; @import './DocFindBar'; diff --git a/src/lib/viewers/image/Image.scss b/src/lib/viewers/image/Image.scss index 7ad169879..2696dda74 100644 --- a/src/lib/viewers/image/Image.scss +++ b/src/lib/viewers/image/Image.scss @@ -1,5 +1,3 @@ -@import '../../annotations/Annotator'; - .bp-image { border: 0 none; bottom: 0;