|
|
@ -476,7 +476,7 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight, |
|
|
|
return element; |
|
|
|
return element; |
|
|
|
} |
|
|
|
} |
|
|
|
function createCommentAnnotation(type, item) { |
|
|
|
function createCommentAnnotation(type, item) { |
|
|
|
var annotContainer = document.createElement('section'); |
|
|
|
var annotContainer = document.createElement('section'); |
|
|
|
annotContainer.className = 'annotComment'; |
|
|
|
annotContainer.className = 'annotComment'; |
|
|
|
|
|
|
|
|
|
|
|
var annotImage = createElementWithStyle('div', item); |
|
|
|
var annotImage = createElementWithStyle('div', item); |
|
|
@ -486,20 +486,21 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight, |
|
|
|
var annotTitle = document.createElement('h1'); |
|
|
|
var annotTitle = document.createElement('h1'); |
|
|
|
var annotContent = document.createElement('p'); |
|
|
|
var annotContent = document.createElement('p'); |
|
|
|
|
|
|
|
|
|
|
|
annotDetails.style.left = (Math.floor(item.x - view.x + item.width) * scale) + 'px'; |
|
|
|
var offsetPos = Math.floor(item.x - view.x + item.width); |
|
|
|
|
|
|
|
annotDetails.style.left = (offsetPos * scale) + 'px'; |
|
|
|
annotDetails.style.top = (Math.floor(item.y - view.y) * scale) + 'px'; |
|
|
|
annotDetails.style.top = (Math.floor(item.y - view.y) * scale) + 'px'; |
|
|
|
annotTitle.textContent = item.title; |
|
|
|
annotTitle.textContent = item.title; |
|
|
|
|
|
|
|
|
|
|
|
if(!item.content) { |
|
|
|
if (!item.content) { |
|
|
|
annotContent.style.display = 'none'; |
|
|
|
annotContent.style.display = 'none'; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
annotContent.innerHTML = item.content.replace('\n', '<br />'); |
|
|
|
annotContent.innerHTML = item.content.replace('\n', '<br />'); |
|
|
|
annotImage.addEventListener('mouseover', function() { |
|
|
|
annotImage.addEventListener('mouseover', function() { |
|
|
|
this.nextSibling.style.display = 'block'; |
|
|
|
this.nextSibling.style.display = 'block'; |
|
|
|
}, true); |
|
|
|
}, true); |
|
|
|
|
|
|
|
|
|
|
|
annotImage.addEventListener('mouseout', function() { |
|
|
|
annotImage.addEventListener('mouseout', function() { |
|
|
|
this.nextSibling.style.display = 'none'; |
|
|
|
this.nextSibling.style.display = 'none'; |
|
|
|
}, true); |
|
|
|
}, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -526,7 +527,7 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight, |
|
|
|
case 'Text': |
|
|
|
case 'Text': |
|
|
|
case 'Check': |
|
|
|
case 'Check': |
|
|
|
var comment = createCommentAnnotation(item.name, item); |
|
|
|
var comment = createCommentAnnotation(item.name, item); |
|
|
|
if(comment) |
|
|
|
if (comment) |
|
|
|
div.appendChild(comment); |
|
|
|
div.appendChild(comment); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|