Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: remoting/webapp/client_session.js

Issue 558283002: Fix bump-scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer feedback. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/client_session.js
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index 13e7d7e9eeaa738bf8fd4146015f5c1a1ef242db..02c2dddb384da704007fb1352e459a1e0fa25283 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -1330,9 +1330,6 @@ remoting.ClientSession.prototype.onShowOptionsMenu_ = function() {
* @private
*/
remoting.ClientSession.prototype.scroll_ = function(dx, dy) {
- var plugin = this.plugin_.element();
- var style = plugin.style;
-
/**
* Helper function for x- and y-scrolling
* @param {number|string} curr The current margin, eg. "10px".
@@ -1352,6 +1349,9 @@ remoting.ClientSession.prototype.scroll_ = function(dx, dy) {
return result + 'px';
};
+ var plugin = this.plugin_.element();
+ var style = this.container_.style;
+
var stopX = { stop: false };
var clientArea = this.getClientArea_();
style.marginLeft = adjustMargin(style.marginLeft, dx, clientArea.width,
@@ -1365,11 +1365,8 @@ remoting.ClientSession.prototype.scroll_ = function(dx, dy) {
};
remoting.ClientSession.prototype.resetScroll_ = function() {
- if (this.plugin_) {
- var plugin = this.plugin_.element();
- plugin.style.marginTop = '0px';
- plugin.style.marginLeft = '0px';
- }
+ this.container_.style.marginTop = '0px';
+ this.container_.style.marginLeft = '0px';
};
/**
@@ -1532,8 +1529,7 @@ remoting.ClientSession.prototype.updateMouseCursorImage_ =
* @return {{top: number, left:number}} The top-left corner of the plugin.
*/
remoting.ClientSession.prototype.getPluginPositionForTesting = function() {
- var plugin = this.plugin_.element();
- var style = plugin.style;
+ var style = this.container_.style;
return {
top: parseFloat(style.marginTop),
left: parseFloat(style.marginLeft)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698