mirror of
https://github.com/Hopiu/ep_page_view.git
synced 2026-03-16 20:20:24 +00:00
fix redrawing of page breaks
This commit is contained in:
parent
393d99777c
commit
28e36a64d1
1 changed files with 12 additions and 4 deletions
|
|
@ -192,12 +192,14 @@ exports.aceEditEvent = function(hook, callstack, editorInfo, rep, documentAttrib
|
|||
var lineNumber = 0;
|
||||
|
||||
var HTMLLines = $('iframe[name="ace_outer"]').contents().find('iframe').contents().find("#innerdocbody").children("div");
|
||||
$('.pageBreakComputed').remove();
|
||||
|
||||
// Remove all computed page breaks
|
||||
$('iframe[name="ace_outer"]').contents().find('iframe').contents().find("#innerdocbody").children("div").find('.pageBreakComputed').remove();
|
||||
|
||||
$(HTMLLines).each(function(){ // For each line
|
||||
var y = $(this).context.offsetTop;
|
||||
$(HTMLLines).each(function(){ // For each line
|
||||
var y = $(this).context.offsetTop; // y is the offset of this line
|
||||
var id = $(this)[0].id; // get the id of the link
|
||||
var height = $(this).height();
|
||||
var height = $(this).height(); // the height of the line
|
||||
|
||||
// How many PX since last break?
|
||||
var lastLine = lineNumber-1;
|
||||
|
|
@ -211,6 +213,9 @@ exports.aceEditEvent = function(hook, callstack, editorInfo, rep, documentAttrib
|
|||
|
||||
// Does it already have any children with teh class pageBreak?
|
||||
var manualBreak = $(this).children().hasClass("pageBreak");
|
||||
|
||||
// Debug statement for lulz
|
||||
// console.log(this, manualBreak); // This bit is fine
|
||||
|
||||
// If it's a manualBreak then reset pxSinceLastBreak to 0;
|
||||
if(manualBreak) pxSinceLastBreak = 0;
|
||||
|
|
@ -241,4 +246,7 @@ exports.aceEditEvent = function(hook, callstack, editorInfo, rep, documentAttrib
|
|||
}
|
||||
lineNumber++;
|
||||
});
|
||||
|
||||
// Debuggable object containing all lines status
|
||||
// console.log(lines);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue