IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
1650 | 1650 | // If we have split the block, adds a temporary span at the |
1651 | 1651 | // range position and scroll relatively to it. |
1652 | 1652 | var start = this.getStartElement(); |
1653 | | start.scrollIntoView(); |
| 1653 | start.scrollIntoParent(); |
1654 | 1654 | } |
1655 | 1655 | }; |
1656 | 1656 | })(); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
313 | 313 | |
314 | 314 | editor.getSelection().selectRanges(savedSelection); |
315 | 315 | var element = editor.getSelection().getStartElement(); |
316 | | element && element.scrollIntoView( true ); |
| 316 | element && element.scrollIntoParent(); |
317 | 317 | } |
318 | 318 | |
319 | 319 | else |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
239 | 239 | tmpNode.setHtml( ' ' ); |
240 | 240 | |
241 | 241 | range.insertNode( tmpNode ); |
242 | | tmpNode.scrollIntoView(); |
| 242 | tmpNode.scrollIntoParent(); |
243 | 243 | range.deleteContents(); |
244 | 244 | } |
245 | 245 | else |
246 | 246 | { |
247 | 247 | // We may use the above scroll logic for the new block case |
248 | 248 | // too, but it gives some weird result with Opera. |
249 | | newBlock.scrollIntoView(); |
| 249 | newBlock.scrollIntoParent(); |
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
… |
… |
|
359 | 359 | dummy = doc.createElement( 'br' ); |
360 | 360 | |
361 | 361 | dummy.insertBefore( lineBreak.getNext() ); |
362 | | dummy.scrollIntoView(); |
| 362 | dummy.scrollIntoParent(); |
363 | 363 | dummy.remove(); |
364 | 364 | } |
365 | 365 | } |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
1396 | 1396 | return { x : x, y : y }; |
1397 | 1397 | }, |
1398 | 1398 | |
1399 | | scrollIntoView : function( alignTop ) |
| 1399 | /** |
| 1400 | * Make any page element visible inside one of the ancestor by scrolling the parent. |
| 1401 | * @param {CKEDITOR.dom.element|CKEDITOR.dom.window} parent The container to scroll into. |
| 1402 | * @param {Boolean} [alignToTop] Align the element's top side with the container's. |
| 1403 | * @param {Boolean} [hscroll] Whether horizontal overflow should be considered. |
| 1404 | */ |
| 1405 | scrollIntoParent : function( parent, alignToTop, hscroll ) |
1400 | 1406 | { |
1401 | | // Get the element window. |
1402 | | var win = this.getWindow(), |
1403 | | winHeight = win.getViewPaneSize().height; |
| 1407 | !alignToTop && ( alignToTop = 1 ); |
| 1408 | !parent && ( parent = this.getWindow() ); |
1404 | 1409 | |
1405 | | // Starts from the offset that will be scrolled with the negative value of |
1406 | | // the visible window height. |
1407 | | var offset = winHeight * -1; |
| 1410 | // On window <html> is scrolled while quirks scrolls <body>. |
| 1411 | if ( parent instanceof CKEDITOR.dom.window ) |
| 1412 | { |
| 1413 | doc = new CKEDITOR.dom.document( parent.$.document ); |
| 1414 | parent = CKEDITOR.env.quirks ? doc.getDocumentElement() : doc.getBody(); |
| 1415 | } |
1408 | 1416 | |
1409 | | // Append the view pane's height if align to top. |
1410 | | // Append element height if we are aligning to the bottom. |
1411 | | if ( alignTop ) |
1412 | | offset += winHeight; |
1413 | | else |
| 1417 | var doc = parent.getDocument(); |
| 1418 | |
| 1419 | var thisPos = this.getDocumentPosition( doc ), |
| 1420 | parentPos = parent.getDocumentPosition( doc ), |
| 1421 | eh = this.$.offsetHeight, |
| 1422 | ew = this.$.offsetWidth, |
| 1423 | ch = parent.$.clientHeight, |
| 1424 | cw = parent.$.clientWidth, |
| 1425 | lt, |
| 1426 | br; |
| 1427 | |
| 1428 | // Left-top margins. |
| 1429 | lt = |
1414 | 1430 | { |
1415 | | offset += this.$.offsetHeight || 0; |
| 1431 | x : thisPos.x - parentPos.x || 0, |
| 1432 | y : thisPos.y - parentPos.y|| 0 |
| 1433 | }; |
1416 | 1434 | |
1417 | | // Consider the margin in the scroll, which is ok for our current needs, but |
1418 | | // needs investigation if we will be using this function in other places. |
1419 | | offset += parseInt( this.getComputedStyle( 'marginBottom' ) || 0, 10 ) || 0; |
| 1435 | // Bottom-right margins. |
| 1436 | br = |
| 1437 | { |
| 1438 | x : thisPos.x + ew - ( parentPos.x + cw ) || 0, |
| 1439 | y : thisPos.y + eh - ( parentPos.y + ch ) || 0 |
| 1440 | }; |
| 1441 | |
| 1442 | if ( lt.y < 0 || br.y > 0 ) |
| 1443 | { |
| 1444 | // Never cut at the top |
| 1445 | if ( alignToTop || lt.y < 0 ) |
| 1446 | parent.$.scrollTop += lt.y; |
| 1447 | else |
| 1448 | parent.$.scrollTop += br.y; |
| 1449 | |
1420 | 1450 | } |
1421 | 1451 | |
1422 | | // Append the offsets for the entire element hierarchy. |
1423 | | var elementPosition = this.getDocumentPosition(); |
1424 | | offset += elementPosition.y; |
| 1452 | if ( hscroll ) |
| 1453 | { |
| 1454 | if ( lt.x < 0 || br.x > 0 ) |
| 1455 | { |
| 1456 | // Never cut at the left |
| 1457 | if ( alignToTop || lt.x < 0 ) |
| 1458 | parent.$.scrollLeft += lt.x; |
| 1459 | else |
| 1460 | parent.$.scrollLeft += br.x; |
| 1461 | } |
| 1462 | } |
| 1463 | }, |
1425 | 1464 | |
1426 | | // offset value might be out of range(nagative), fix it(#3692). |
1427 | | offset = offset < 0 ? 0 : offset; |
| 1465 | /** |
| 1466 | * Make any page element visible inside of the browser viewport. |
| 1467 | * @param {Boolean} [alignToTop] |
| 1468 | */ |
| 1469 | scrollIntoView : function( alignToTop ) |
| 1470 | { |
| 1471 | var parent = this.getParent(); |
| 1472 | if ( !parent ) return; |
1428 | 1473 | |
1429 | | // Scroll the window to the desired position, if not already visible(#3795). |
1430 | | var currentScroll = win.getScrollPosition().y; |
1431 | | if ( offset > currentScroll || offset < currentScroll - winHeight ) |
1432 | | win.$.scrollTo( 0, offset ); |
| 1474 | // Scroll the element into parent container from the inner out. |
| 1475 | do |
| 1476 | { |
| 1477 | // Check ancestors that overflows. |
| 1478 | var overflowed = |
| 1479 | parent.$.clientWidth && parent.$.clientWidth < parent.$.scrollWidth |
| 1480 | || parent.$.clientHeight && parent.$.clientHeight < parent.$.scrollHeight; |
| 1481 | |
| 1482 | if ( overflowed ) |
| 1483 | this.scrollIntoParent( parent, alignToTop, 1 ); |
| 1484 | |
| 1485 | // Walk across the frame. |
| 1486 | if ( parent.is( 'html' ) ) |
| 1487 | { |
| 1488 | var win = parent.getWindow(); |
| 1489 | |
| 1490 | // Avoid security error. |
| 1491 | try |
| 1492 | { |
| 1493 | var iframe = win.$.frameElement; |
| 1494 | iframe && ( parent = new CKEDITOR.dom.element( iframe ) ); |
| 1495 | } |
| 1496 | catch(er){} |
| 1497 | } |
| 1498 | } |
| 1499 | while ( parent = parent.getParent() ); |
| 1500 | |
1433 | 1501 | }, |
1434 | 1502 | |
1435 | 1503 | setState : function( state ) |