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>
|
</template>
|
||||||
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
|
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
|
||||||
<gr-storage id="storage"></gr-storage>
|
<gr-storage id="storage"></gr-storage>
|
||||||
<gr-diff-cursor
|
<gr-diff-cursor id="cursor"></gr-diff-cursor>
|
||||||
id="cursor"
|
|
||||||
fold-offset-top="[[topMargin]]"></gr-diff-cursor>
|
|
||||||
</template>
|
</template>
|
||||||
<script src="gr-file-list.js"></script>
|
<script src="gr-file-list.js"></script>
|
||||||
</dom-module>
|
</dom-module>
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
drafts: Object,
|
drafts: Object,
|
||||||
revisions: Object,
|
revisions: Object,
|
||||||
projectConfig: Object,
|
projectConfig: Object,
|
||||||
topMargin: Number,
|
|
||||||
selectedIndex: {
|
selectedIndex: {
|
||||||
type: Number,
|
type: Number,
|
||||||
notify: true,
|
notify: true,
|
||||||
@@ -352,7 +351,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Don't scroll if it's already in view.
|
// 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) {
|
top < window.pageYOffset + window.innerHeight - el.clientHeight) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
},
|
},
|
||||||
comments: Object,
|
comments: Object,
|
||||||
projectConfig: Object,
|
projectConfig: Object,
|
||||||
topMargin: Number,
|
|
||||||
showReplyButtons: {
|
showReplyButtons: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: false,
|
value: false,
|
||||||
@@ -52,7 +51,7 @@
|
|||||||
offsetParent = offsetParent.offsetParent) {
|
offsetParent = offsetParent.offsetParent) {
|
||||||
top += offsetParent.offsetTop;
|
top += offsetParent.offsetTop;
|
||||||
}
|
}
|
||||||
window.scrollTo(0, top - this.topMargin);
|
window.scrollTo(0, top);
|
||||||
this._highlightEl(el);
|
this._highlightEl(el);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ limitations under the License.
|
|||||||
id="cursorManager"
|
id="cursorManager"
|
||||||
scroll="keep-visible"
|
scroll="keep-visible"
|
||||||
cursor-target-class="target-row"
|
cursor-target-class="target-row"
|
||||||
fold-offset-top="[[foldOffsetTop]]"
|
|
||||||
target="{{diffRow}}"></gr-cursor-manager>
|
target="{{diffRow}}"></gr-cursor-manager>
|
||||||
</template>
|
</template>
|
||||||
<script src="gr-diff-cursor.js"></script>
|
<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
|
* 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
|
* the first chunk) the next time the diff renders. It is set back to null
|
||||||
|
|||||||
@@ -63,15 +63,6 @@
|
|||||||
type: String,
|
type: String,
|
||||||
value: ScrollBehavior.NEVER,
|
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() {
|
detached: function() {
|
||||||
@@ -214,7 +205,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.scroll === ScrollBehavior.KEEP_VISIBLE &&
|
if (this.scroll === ScrollBehavior.KEEP_VISIBLE &&
|
||||||
top > window.pageYOffset + this.foldOffsetTop &&
|
top > window.pageYOffset &&
|
||||||
top < window.pageYOffset + window.innerHeight) { return; }
|
top < window.pageYOffset + window.innerHeight) { return; }
|
||||||
|
|
||||||
// Scroll the element to the middle of the window. Dividing by a third
|
// Scroll the element to the middle of the window. Dividing by a third
|
||||||
|
|||||||
Reference in New Issue
Block a user