From 465611a2ff3cd453f5ac3c22cdbd6a8e9bb13b96 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Fri, 17 Jul 2015 21:51:24 +0200 Subject: [PATCH] More cleanup regarding annotation border styles --- src/core/annotation.js | 1 - src/display/annotation_helper.js | 6 +++--- test/unit/annotation_layer_spec.js | 6 ++---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/core/annotation.js b/src/core/annotation.js index 22ee0bf78..3fb6f9594 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -160,7 +160,6 @@ var Annotation = (function AnnotationClosure() { this.borderStyle.setHorizontalCornerRadius(array[0]); this.borderStyle.setVerticalCornerRadius(array[1]); this.borderStyle.setWidth(array[2]); - this.borderStyle.setStyle('S'); if (array.length === 4) { // Dash array available this.borderStyle.setDashArray(array[3]); diff --git a/src/display/annotation_helper.js b/src/display/annotation_helper.js index af30c28f2..922535960 100644 --- a/src/display/annotation_helper.js +++ b/src/display/annotation_helper.js @@ -45,7 +45,7 @@ var AnnotationUtils = (function AnnotationUtilsClosure() { style.fontFamily = fontFamily + fallbackName; } - function initContainer(item, drawBorder) { + function initContainer(item) { var container = document.createElement('section'); var cstyle = container.style; var width = item.rect[2] - item.rect[0]; @@ -149,7 +149,7 @@ var AnnotationUtils = (function AnnotationUtilsClosure() { rect[2] = rect[0] + (rect[3] - rect[1]); // make it square } - var container = initContainer(item, false); + var container = initContainer(item); container.className = 'annotText'; var image = document.createElement('img'); @@ -256,7 +256,7 @@ var AnnotationUtils = (function AnnotationUtilsClosure() { } function getHtmlElementForLinkAnnotation(item) { - var container = initContainer(item, true); + var container = initContainer(item); container.className = 'annotLink'; var link = document.createElement('a'); diff --git a/test/unit/annotation_layer_spec.js b/test/unit/annotation_layer_spec.js index 889004f35..1c45b633f 100644 --- a/test/unit/annotation_layer_spec.js +++ b/test/unit/annotation_layer_spec.js @@ -1,6 +1,6 @@ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ -/* globals expect, it, describe, Dict, Annotation, AnnotationBorderStyle, +/* globals expect, it, describe, Dict, Name, Annotation, AnnotationBorderStyle, AnnotationBorderStyleType */ 'use strict'; @@ -79,9 +79,7 @@ describe('Annotation layer', function() { it('should set and get a valid style', function() { var borderStyle = new AnnotationBorderStyle(); - var dict = new Dict(); - dict.name = 'D'; - borderStyle.setStyle(dict); + borderStyle.setStyle(Name.get('D')); expect(borderStyle.style).toEqual(AnnotationBorderStyleType.DASHED); });