OLD | NEW |
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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 newElementPosition.width = totalWidth - borderRadius * 2; | 233 newElementPosition.width = totalWidth - borderRadius * 2; |
234 newElementPosition.height += scrollerWidth; | 234 newElementPosition.height += scrollerWidth; |
235 horizontalAlignment = "left"; | 235 horizontalAlignment = "left"; |
236 if (verticalAlignment === WebInspector.Popover.Orientation.Bottom) | 236 if (verticalAlignment === WebInspector.Popover.Orientation.Bottom) |
237 newElementPosition.y -= scrollerWidth; | 237 newElementPosition.y -= scrollerWidth; |
238 // Position arrow accurately. | 238 // Position arrow accurately. |
239 this._popupArrowElement.style.left = Math.max(0, anchorBox.x - newEl
ementPosition.x - borderRadius - arrowRadius + anchorBox.width / 2) + "px"; | 239 this._popupArrowElement.style.left = Math.max(0, anchorBox.x - newEl
ementPosition.x - borderRadius - arrowRadius + anchorBox.width / 2) + "px"; |
240 } | 240 } |
241 | 241 |
242 this.element.className = WebInspector.Popover._classNamePrefix + " " + v
erticalAlignment + "-" + horizontalAlignment + "-arrow"; | 242 this.element.className = WebInspector.Popover._classNamePrefix + " " + v
erticalAlignment + "-" + horizontalAlignment + "-arrow"; |
243 this.element.positionAt(newElementPosition.x, newElementPosition.y - bor
derWidth, container); | 243 this.element.positionAt(newElementPosition.x, Math.max(0, newElementPosi
tion.y - borderWidth), container); |
244 this.element.style.width = newElementPosition.width + borderWidth * 2 +
"px"; | 244 this.element.style.width = newElementPosition.width + borderWidth * 2 +
"px"; |
245 this.element.style.height = newElementPosition.height + borderWidth * 2
+ "px"; | 245 this.element.style.height = newElementPosition.height + borderWidth * 2
+ "px"; |
246 }, | 246 }, |
247 | 247 |
248 __proto__: WebInspector.Widget.prototype | 248 __proto__: WebInspector.Widget.prototype |
249 } | 249 } |
250 | 250 |
251 /** | 251 /** |
252 * @constructor | 252 * @constructor |
253 * @param {!Element} panelElement | 253 * @param {!Element} panelElement |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 this._resetHoverTimer(); | 415 this._resetHoverTimer(); |
416 } | 416 } |
417 } | 417 } |
418 } | 418 } |
419 | 419 |
420 /** @enum {string} */ | 420 /** @enum {string} */ |
421 WebInspector.Popover.Orientation = { | 421 WebInspector.Popover.Orientation = { |
422 Top: "top", | 422 Top: "top", |
423 Bottom: "bottom" | 423 Bottom: "bottom" |
424 } | 424 } |
OLD | NEW |