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

Unified Diff: ui/webui/resources/js/cr/ui/splitter.js

Issue 2864433002: [MD Bookmarks] Add hover border to sidebar splitter. (Closed)
Patch Set: address comments Created 3 years, 7 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 | « chrome/browser/resources/md_bookmarks/app.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/splitter.js
diff --git a/ui/webui/resources/js/cr/ui/splitter.js b/ui/webui/resources/js/cr/ui/splitter.js
index b4260e1b185b664c950c63111863ee186c5ec54b..b655f5b923d6fcd6a88e260f3c8e6a379efe524b 100644
--- a/ui/webui/resources/js/cr/ui/splitter.js
+++ b/ui/webui/resources/js/cr/ui/splitter.js
@@ -233,11 +233,15 @@ cr.define('cr.ui', function() {
*/
handleSplitterDragStart: function() {
// Use the computed width style as the base so that we can ignore what
- // box sizing the element has.
+ // box sizing the element has. Add the difference between offset and
+ // client widths to account for any scrollbars.
var targetElement = this.getResizeTarget_();
var doc = targetElement.ownerDocument;
this.startWidth_ =
- parseFloat(doc.defaultView.getComputedStyle(targetElement).width);
+ parseFloat(doc.defaultView.getComputedStyle(targetElement).width) +
+ targetElement.offsetWidth - targetElement.clientWidth;
+
+ this.classList.add('splitter-active');
},
/**
@@ -265,6 +269,8 @@ cr.define('cr.ui', function() {
parseFloat(doc.defaultView.getComputedStyle(targetElement).width);
if (this.startWidth_ != computedWidth)
cr.dispatchSimpleEvent(this, 'resize');
+
+ this.classList.remove('splitter-active');
},
};
« no previous file with comments | « chrome/browser/resources/md_bookmarks/app.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698