Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -586,29 +586,23 @@ |
587 | 587 | if ( typeof selector == 'undefined' ) { |
588 | 588 | selector = '*'; |
589 | 589 | } |
590 | | - |
591 | | - // Start at the selection's start and traverse the DOM backwards |
592 | | - // This is done by traversing an element's children first, then the element itself, then its parent |
593 | 590 | var e; |
594 | 591 | if ( context.$iframe[0].contentWindow.getSelection ) { |
595 | 592 | // Firefox and Opera |
596 | 593 | var selection = context.$iframe[0].contentWindow.getSelection(); |
597 | 594 | // On load, webkit seems to not have a valid selection |
598 | 595 | if ( selection.baseNode !== null ) { |
| 596 | + // Start at the selection's start and traverse the DOM backwards |
| 597 | + // This is done by traversing an element's children first, then the element itself, then its parent |
599 | 598 | e = selection.getRangeAt( 0 ).startContainer; |
600 | 599 | } else { |
601 | 600 | return $( [] ); |
602 | 601 | } |
603 | 602 | } else if ( context.$iframe[0].contentWindow.document.selection ) { |
604 | 603 | // IE |
605 | | - // range.startContainer or similar functionality is not available in IE, so we have to |
606 | | - // traverse the DOM to find out which element the selection starts in |
607 | | - var range = context.$iframe[0].contentWindow.document.selection.createRange(), |
608 | | - preRange = context.$iframe[0].contentWindow.document.body.createTextRange(); |
609 | | - preRange.setEndPoint( "EndToStart", range ); |
610 | | - // TODO finish |
| 604 | + // TODO |
| 605 | + return $( [] ); |
611 | 606 | } |
612 | | - |
613 | 607 | if ( e.nodeName != '#text' ) { |
614 | 608 | // The selection is not in a textnode, but between two non-text nodes |
615 | 609 | // (usually inside the <body> between two <br>s). Go to the rightmost |