Fixed first section in scroll link extension
This commit is contained in:
parent
d8bfb94cbd
commit
4e2ad5766b
@ -54,16 +54,19 @@ define([
|
|||||||
var htmlSectionOffset;
|
var htmlSectionOffset;
|
||||||
var previewScrollTop = $previewElt.scrollTop();
|
var previewScrollTop = $previewElt.scrollTop();
|
||||||
$previewElt.find(".preview-content > .se-section-delimiter").each(function() {
|
$previewElt.find(".preview-content > .se-section-delimiter").each(function() {
|
||||||
|
if(htmlSectionOffset === undefined) {
|
||||||
|
// Force start to 0 for the first section
|
||||||
|
htmlSectionOffset = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
var $delimiterElt = $(this);
|
var $delimiterElt = $(this);
|
||||||
// Consider div scroll position
|
// Consider div scroll position
|
||||||
var newSectionOffset = $delimiterElt.position().top + previewScrollTop;
|
var newSectionOffset = $delimiterElt.position().top + previewScrollTop;
|
||||||
if(htmlSectionOffset !== undefined) {
|
htmlSectionList.push({
|
||||||
htmlSectionList.push({
|
startOffset: htmlSectionOffset,
|
||||||
startOffset: htmlSectionOffset,
|
endOffset: newSectionOffset,
|
||||||
endOffset: newSectionOffset,
|
height: newSectionOffset - htmlSectionOffset
|
||||||
height: newSectionOffset - htmlSectionOffset
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
htmlSectionOffset = newSectionOffset;
|
htmlSectionOffset = newSectionOffset;
|
||||||
});
|
});
|
||||||
// Last section
|
// Last section
|
||||||
|
@ -298,7 +298,7 @@
|
|||||||
<label class="col-lg-4 control-label"
|
<label class="col-lg-4 control-label"
|
||||||
for="input-import-image-size">Size limit (optional)</label>
|
for="input-import-image-size">Size limit (optional)</label>
|
||||||
<div class="col-lg-7 form-inline">
|
<div class="col-lg-7 form-inline">
|
||||||
<input type="text" id="input-import-image-size" placeholder="123"
|
<input type="text" id="input-import-image-size" placeholder="0"
|
||||||
class="col-lg-3 form-control"> px
|
class="col-lg-3 form-control"> px
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user