Remove topMargin since the header is no longer pinned
Change-Id: I8a39995f0e1ec20c2cbbb869091744e92af45d0f
This commit is contained in:
@@ -181,9 +181,7 @@ limitations under the License.
|
||||
</template>
|
||||
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
|
||||
<gr-storage id="storage"></gr-storage>
|
||||
<gr-diff-cursor
|
||||
id="cursor"
|
||||
fold-offset-top="[[topMargin]]"></gr-diff-cursor>
|
||||
<gr-diff-cursor id="cursor"></gr-diff-cursor>
|
||||
</template>
|
||||
<script src="gr-file-list.js"></script>
|
||||
</dom-module>
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
drafts: Object,
|
||||
revisions: Object,
|
||||
projectConfig: Object,
|
||||
topMargin: Number,
|
||||
selectedIndex: {
|
||||
type: Number,
|
||||
notify: true,
|
||||
@@ -352,7 +351,7 @@
|
||||
}
|
||||
|
||||
// Don't scroll if it's already in view.
|
||||
if (top > window.pageYOffset + this.topMargin &&
|
||||
if (top > window.pageYOffset &&
|
||||
top < window.pageYOffset + window.innerHeight - el.clientHeight) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
},
|
||||
comments: Object,
|
||||
projectConfig: Object,
|
||||
topMargin: Number,
|
||||
showReplyButtons: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
@@ -52,7 +51,7 @@
|
||||
offsetParent = offsetParent.offsetParent) {
|
||||
top += offsetParent.offsetTop;
|
||||
}
|
||||
window.scrollTo(0, top - this.topMargin);
|
||||
window.scrollTo(0, top);
|
||||
this._highlightEl(el);
|
||||
},
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ limitations under the License.
|
||||
id="cursorManager"
|
||||
scroll="keep-visible"
|
||||
cursor-target-class="target-row"
|
||||
fold-offset-top="[[foldOffsetTop]]"
|
||||
target="{{diffRow}}"></gr-cursor-manager>
|
||||
</template>
|
||||
<script src="gr-diff-cursor.js"></script>
|
||||
|
||||
@@ -54,11 +54,6 @@
|
||||
},
|
||||
},
|
||||
|
||||
foldOffsetTop: {
|
||||
type: Number,
|
||||
value: 0,
|
||||
},
|
||||
|
||||
/**
|
||||
* If set, the cursor will attempt to move to the line number (instead of
|
||||
* the first chunk) the next time the diff renders. It is set back to null
|
||||
|
||||
@@ -63,15 +63,6 @@
|
||||
type: String,
|
||||
value: ScrollBehavior.NEVER,
|
||||
},
|
||||
|
||||
/**
|
||||
* When using the 'keep-visible' scroll behavior, set an offset to the top
|
||||
* of the window for what is considered above the upper fold.
|
||||
*/
|
||||
foldOffsetTop: {
|
||||
type: Number,
|
||||
value: 0,
|
||||
},
|
||||
},
|
||||
|
||||
detached: function() {
|
||||
@@ -214,7 +205,7 @@
|
||||
}
|
||||
|
||||
if (this.scroll === ScrollBehavior.KEEP_VISIBLE &&
|
||||
top > window.pageYOffset + this.foldOffsetTop &&
|
||||
top > window.pageYOffset &&
|
||||
top < window.pageYOffset + window.innerHeight) { return; }
|
||||
|
||||
// Scroll the element to the middle of the window. Dividing by a third
|
||||
|
||||
Reference in New Issue
Block a user