Commit 057dd7b8 authored by Julie Blanc's avatar Julie Blanc
Browse files

[notes-float] float right or left

parent fc60a07e
......@@ -10,13 +10,12 @@ note.pagedjs_note {
}
*/
.pagedjs_left_page .pagedjs_area-notes {
padding-right: 6mm;
padding-left: 6mm;
.pagedjs_left_page .pagedjs_notes-area_content {
margin-right: 16px;
}
.pagedjs_right_page .pagedjs_area-notes {
padding-left: 12mm;
.pagedjs_right_page .pagedjs_notes-area_content {
margin-left: 16px;
}
......@@ -80,7 +79,6 @@ note.pagedjs_note {
font-size: 12px;
line-height: 16px;
margin-top: 20px;
margin-right: 16px;
}
/* .pagedjs_note + .pagedjs_note{ margin-top: 16px; } */
......
......@@ -46,7 +46,8 @@ function addStyleNotesArea({width, positionLeft, positionRight}){
return 'right'
} else return pos;
});
const positionRightParsed = positionLeft.split(' ')
console.log("positionLeftParsed = " + positionLeftParsed);
const positionRightParsed = positionRight.split(' ')
.map(pos => {
if (pos === 'outside') {
return 'right'
......@@ -54,17 +55,33 @@ function addStyleNotesArea({width, positionLeft, positionRight}){
return 'left'
} else return pos;
});
console.log("positionRightParsed = " + positionRightParsed);
let floatLeft;
if(positionLeftParsed[0] == 'right' || positionLeftParsed[1] && positionLeftParsed[1] == 'right'){
floatLeft = 'right';
}else{
floatLeft = 'left';
}
let floatRight;
if(positionRightParsed[0] == 'right' || positionRightParsed[1] && positionRightParsed[1] == 'right'){
floatRight = 'right';
}else{
floatRight = 'left';
}
const css = `
.pagedjs_left_page .pagedjs_notes-area {
${common}
float: ${positionRightParsed.length > 1 ? 'left' : positionLeftParsed[1]};
float: ${floatLeft};
}
.pagedjs_right_page .pagedjs_notes-area {
${common}
float: ${positionRightParsed.length > 1 ? 'left' : positionRightParsed[1]};
float: ${floatRight};
}
`
addCSS(css);
console.log(css);
}
class NotesFloat extends Paged.Handler {
constructor(chunker, polisher, caller) {
......@@ -251,7 +268,6 @@ class NotesFloat extends Paged.Handler {
if (pageConf.includes('bottom')) {
notesArea.style.marginTop = pageContentArea - noteAreaHeight - 1 + 'px'; // subtract 1px to avoid overflow
notesArea.style.top = "1px";
}
}else{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment