IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
247 | 247 | else |
248 | 248 | target.removeStyle( 'height' ); |
249 | 249 | |
| 250 | // Place for measurement. |
| 251 | element.setStyle( 'left', CKEDITOR.tools.cssLength( left ) ); |
| 252 | |
250 | 253 | var panelElement = panel.element, |
251 | 254 | panelWindow = panelElement.getWindow(), |
252 | | windowScroll = panelWindow.getScrollPosition(), |
253 | | viewportSize = panelWindow.getViewPaneSize(), |
254 | | panelSize = |
255 | | { |
256 | | 'height' : panelElement.$.offsetHeight, |
257 | | 'width' : panelElement.$.offsetWidth |
258 | | }; |
| 255 | rect = element.$.getBoundingClientRect(), |
| 256 | viewportSize = panelWindow.getViewPaneSize(); |
259 | 257 | |
260 | | // If the menu is horizontal off, shift it toward |
261 | | // the opposite language direction. |
262 | | if ( rtl ? left < 0 : left + panelSize.width > viewportSize.width + windowScroll.x ) |
263 | | left += ( panelSize.width * ( rtl ? 1 : -1 ) ); |
| 258 | // Compensation for browsers that dont support "width" and "height". |
| 259 | var rectWidth = rect.width || rect.right - rect.left, |
| 260 | rectHeight = rect.height || rect.bottom - rect.top; |
264 | 261 | |
265 | | // Vertical off screen is simpler. |
266 | | if ( top + panelSize.height > viewportSize.height + windowScroll.y ) |
267 | | top -= panelSize.height; |
| 262 | // Check to flip the panel display direction to opposite side |
| 263 | // when there's not enough space available. |
| 264 | var spaceAfter = rtl ? rect.right : viewportSize.width - rect.left, |
| 265 | spaceBefore = rtl ? viewportSize.width - rect.right : rect.left; |
| 266 | |
| 267 | // Flip horizontally. |
| 268 | if ( spaceAfter - rectWidth < 0 && spaceBefore > spaceAfter ) |
| 269 | left += ( rectWidth * ( rtl ? 1 : -1 ) ); |
| 270 | |
| 271 | // Flip vertically. |
| 272 | var spaceBelow = viewportSize.height - rect.top, |
| 273 | spaceAbove = rect.top; |
| 274 | |
| 275 | if ( spaceBelow - rectHeight < 0 && spaceAbove > spaceBelow ) |
| 276 | top -= rectHeight; |
268 | 277 | |
269 | 278 | // If IE is in R™TL, we have troubles with absolute |
270 | 279 | // position and horizontal scrolls. Here we have a |