73 | | if ( !element.isReadOnly() ) |
74 | | { |
75 | | if ( element.is( 'a' ) ) |
76 | | evt.data.dialog = ( element.getAttribute( 'name' ) && !element.getAttribute( 'href' ) ) ? 'anchor' : 'link'; |
77 | | else if ( element.is( 'img' ) && element.data( 'cke-real-element-type' ) == 'anchor' ) |
78 | | evt.data.dialog = 'anchor'; |
79 | | } |
| 74 | // Fake anchor image or empty anchor. |
| 75 | if ( ( element = evt.data.element ) |
| 76 | && ( element.is( 'img' ) && element.data( 'cke-real-element-type' ) == 'anchor' |
| 77 | || element.is( 'a' ) && !element.getChildCount() ) ) |
| 78 | { |
| 79 | openDialog = 1; |
| 80 | } |
| 81 | // Link text is fully selected only (#7728). |
| 82 | else |
| 83 | { |
| 84 | var range = editor.getSelection().getRanges()[ 0 ]; |
| 85 | range.shrink( CKEDITOR.SHRINK_TEXT ); |
| 86 | element = range.getCommonAncestor().getAscendant( 'a', 1 ); |
| 87 | if ( element && range.checkBoundaryOfElement( element, CKEDITOR.START ) |
| 88 | && range.checkBoundaryOfElement( element, CKEDITOR.END ) ) |
| 89 | { |
| 90 | openDialog = 1; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | if ( openDialog ) |
| 95 | { |
| 96 | if ( !element.isReadOnly() ) |
| 97 | { |
| 98 | if ( element.is( 'a' ) ) |
| 99 | { |
| 100 | evt.data.dialog = ( element.getAttribute( 'name' ) && ( !element.getAttribute( 'href' ) || !element.getChildCount() ) ) ? 'anchor' : 'link'; |
| 101 | editor.getSelection().selectElement( element ); |
| 102 | } |
| 103 | else if ( element.is( 'img' ) && element.data( 'cke-real-element-type' ) == 'anchor' ) |
| 104 | evt.data.dialog = 'anchor'; |
| 105 | } |
| 106 | } |
| 107 | |