mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-08 03:02:03 +01:00
smell resolve
This commit is contained in:
parent
ea2c2949c1
commit
46805d80d6
1 changed files with 14 additions and 13 deletions
|
@ -41,18 +41,19 @@ const padeditor = (function () {
|
|||
|
||||
function aceReady() {
|
||||
$('#editorloadingbox').hide();
|
||||
const $outerdoc = $('iframe[name="ace_outer"]').contents().find('#outerdocbody');
|
||||
if (readyFunc) {
|
||||
// If a number is in the URI IE #L124 go to that line number
|
||||
const lineNumber = window.location.hash.substr(1);
|
||||
if (lineNumber) {
|
||||
if (lineNumber[0] === 'L') {
|
||||
const lineNumberInt = parseInt(lineNumber.replace('L', ''));
|
||||
if (lineNumberInt) {
|
||||
const $inner = $('iframe[name="ace_outer"]').contents().find('iframe')
|
||||
.contents().find('#innerdocbody');
|
||||
const line = $inner.find(`div:nth-child(${lineNumberInt})`);
|
||||
if (line.length !== 0) {
|
||||
let offsetTop = line.offset().top;
|
||||
const $outerdoc = $('iframe[name="ace_outer"]').contents().find('#outerdocbody');
|
||||
offsetTop += parseInt($outerdoc.css('padding-top').replace('px', ''));
|
||||
offsetTop += parseInt($inner.css('padding-top').replace('px', ''));
|
||||
const $outerdocHTML = $('iframe[name="ace_outer"]').contents()
|
||||
|
@ -62,7 +63,7 @@ const padeditor = (function () {
|
|||
}
|
||||
}
|
||||
}
|
||||
const $outerdoc = $('iframe[name="ace_outer"]').contents().find('#outerdocbody');
|
||||
}
|
||||
// Listen for clicks on sidediv items
|
||||
$outerdoc.find('#sidedivinner').on('click', 'div', function() {
|
||||
const lineNumber = $(this).index() + 1;
|
||||
|
|
Loading…
Reference in a new issue