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

Side by Side Diff: Source/devtools/front_end/Popover.js

Issue 246823003: [DevTools] Minor tweak in popover positioning. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 newElementPosition.height = anchorBox.y - borderRadius * 2 - arr owHeight; 175 newElementPosition.height = anchorBox.y - borderRadius * 2 - arr owHeight;
176 if (this._hasFixedHeight && newElementPosition.height < preferre dHeight) { 176 if (this._hasFixedHeight && newElementPosition.height < preferre dHeight) {
177 newElementPosition.y = borderRadius; 177 newElementPosition.y = borderRadius;
178 newElementPosition.height = preferredHeight; 178 newElementPosition.height = preferredHeight;
179 } 179 }
180 } 180 }
181 verticalAlignment = WebInspector.Popover.Orientation.Bottom; 181 verticalAlignment = WebInspector.Popover.Orientation.Bottom;
182 } else { 182 } else {
183 // Positioning below the anchor. 183 // Positioning below the anchor.
184 newElementPosition.y = anchorBox.y + anchorBox.height + arrowHeight; 184 newElementPosition.y = anchorBox.y + anchorBox.height + arrowHeight;
185 if ((newElementPosition.y + newElementPosition.height + arrowHeight - borderWidth >= totalHeight) && (arrowDirection !== WebInspector.Popover.Orient ation.Top)) { 185 if ((newElementPosition.y + newElementPosition.height + borderRadius >= totalHeight) && (arrowDirection !== WebInspector.Popover.Orientation.Top)) {
186 newElementPosition.height = totalHeight - anchorBox.y - anchorBo x.height - borderRadius * 2 - arrowHeight; 186 newElementPosition.height = totalHeight - borderRadius - newElem entPosition.y;
187 if (this._hasFixedHeight && newElementPosition.height < preferre dHeight) { 187 if (this._hasFixedHeight && newElementPosition.height < preferre dHeight) {
188 newElementPosition.y = totalHeight - preferredHeight - borde rRadius; 188 newElementPosition.y = totalHeight - preferredHeight - borde rRadius;
189 newElementPosition.height = preferredHeight; 189 newElementPosition.height = preferredHeight;
190 } 190 }
191 } 191 }
192 // Align arrow. 192 // Align arrow.
193 verticalAlignment = WebInspector.Popover.Orientation.Top; 193 verticalAlignment = WebInspector.Popover.Orientation.Top;
194 } 194 }
195 195
196 var horizontalAlignment; 196 var horizontalAlignment;
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 this._resetHoverTimer(); 386 this._resetHoverTimer();
387 } 387 }
388 } 388 }
389 } 389 }
390 390
391 /** @enum {string} */ 391 /** @enum {string} */
392 WebInspector.Popover.Orientation = { 392 WebInspector.Popover.Orientation = {
393 Top: "top", 393 Top: "top",
394 Bottom: "bottom" 394 Bottom: "bottom"
395 } 395 }
OLDNEW
« 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