Fixed first section in scroll link extension

This commit is contained in:
benweet 2013-11-19 23:44:31 +00:00
parent d8bfb94cbd
commit 4e2ad5766b
2 changed files with 11 additions and 8 deletions

View File

@ -54,16 +54,19 @@ define([
var htmlSectionOffset;
var previewScrollTop = $previewElt.scrollTop();
$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);
// Consider div scroll position
var newSectionOffset = $delimiterElt.position().top + previewScrollTop;
if(htmlSectionOffset !== undefined) {
htmlSectionList.push({
startOffset: htmlSectionOffset,
endOffset: newSectionOffset,
height: newSectionOffset - htmlSectionOffset
});
}
htmlSectionOffset = newSectionOffset;
});
// Last section

View File

@ -298,7 +298,7 @@
<label class="col-lg-4 control-label"
for="input-import-image-size">Size limit (optional)</label>
<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
</div>
</div>