diff options
Diffstat (limited to 'sources/plugins/elementspath/plugin.js')
-rw-r--r-- | sources/plugins/elementspath/plugin.js | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/sources/plugins/elementspath/plugin.js b/sources/plugins/elementspath/plugin.js index fd02d70..f66d7ad 100644 --- a/sources/plugins/elementspath/plugin.js +++ b/sources/plugins/elementspath/plugin.js | |||
@@ -1,5 +1,5 @@ | |||
1 | /** | 1 | /** |
2 | * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. | 2 | * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. |
3 | * For licensing, see LICENSE.md or http://ckeditor.com/license | 3 | * For licensing, see LICENSE.md or http://ckeditor.com/license |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -17,7 +17,7 @@ | |||
17 | var idBase = editor._.elementsPath.idBase; | 17 | var idBase = editor._.elementsPath.idBase; |
18 | var element = CKEDITOR.document.getById( idBase + '0' ); | 18 | var element = CKEDITOR.document.getById( idBase + '0' ); |
19 | 19 | ||
20 | // Make the first button focus accessible for IE. (#3417) | 20 | // Make the first button focus accessible for IE. (http://dev.ckeditor.com/ticket/3417) |
21 | // Adobe AIR instead need while of delay. | 21 | // Adobe AIR instead need while of delay. |
22 | element && element.focus( CKEDITOR.env.ie || CKEDITOR.env.air ); | 22 | element && element.focus( CKEDITOR.env.ie || CKEDITOR.env.air ); |
23 | } | 23 | } |
@@ -55,7 +55,7 @@ | |||
55 | 55 | ||
56 | CKEDITOR.plugins.add( 'elementspath', { | 56 | CKEDITOR.plugins.add( 'elementspath', { |
57 | // jscs:disable maximumLineLength | 57 | // jscs:disable maximumLineLength |
58 | lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% | 58 | lang: 'af,ar,az,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,es-mx,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,oc,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% |
59 | // jscs:enable maximumLineLength | 59 | // jscs:enable maximumLineLength |
60 | init: function( editor ) { | 60 | init: function( editor ) { |
61 | editor._.elementsPath = { | 61 | editor._.elementsPath = { |
@@ -91,17 +91,26 @@ | |||
91 | } ); | 91 | } ); |
92 | 92 | ||
93 | function onClick( elementIndex ) { | 93 | function onClick( elementIndex ) { |
94 | var element = elementsPath.list[ elementIndex ]; | 94 | var element = elementsPath.list[ elementIndex ], |
95 | selection; | ||
96 | |||
95 | if ( element.equals( editor.editable() ) || element.getAttribute( 'contenteditable' ) == 'true' ) { | 97 | if ( element.equals( editor.editable() ) || element.getAttribute( 'contenteditable' ) == 'true' ) { |
96 | var range = editor.createRange(); | 98 | var range = editor.createRange(); |
97 | range.selectNodeContents( element ); | 99 | range.selectNodeContents( element ); |
98 | range.select(); | 100 | |
101 | selection = range.select(); | ||
99 | } else { | 102 | } else { |
100 | editor.getSelection().selectElement( element ); | 103 | selection = editor.getSelection(); |
104 | selection.selectElement( element ); | ||
105 | } | ||
106 | |||
107 | // Explicitly fire selectionChange when clicking on an element path button. (http://dev.ckeditor.com/ticket/13548) | ||
108 | if ( CKEDITOR.env.ie ) { | ||
109 | editor.fire( 'selectionChange', { selection: selection, path: new CKEDITOR.dom.elementPath( element ) } ); | ||
101 | } | 110 | } |
102 | 111 | ||
103 | // It is important to focus() *after* the above selection | 112 | // It is important to focus() *after* the above selection |
104 | // manipulation, otherwise Firefox will have troubles. #10119 | 113 | // manipulation, otherwise Firefox will have troubles. http://dev.ckeditor.com/ticket/10119 |
105 | editor.focus(); | 114 | editor.focus(); |
106 | } | 115 | } |
107 | 116 | ||
@@ -151,7 +160,7 @@ | |||
151 | filters = elementsPath.filters, | 160 | filters = elementsPath.filters, |
152 | isContentEditable = true, | 161 | isContentEditable = true, |
153 | 162 | ||
154 | // Use elementPath to consider children of editable only (#11124). | 163 | // Use elementPath to consider children of editable only (http://dev.ckeditor.com/ticket/11124). |
155 | elementsChain = editor.elementPath().elements, | 164 | elementsChain = editor.elementPath().elements, |
156 | name; | 165 | name; |
157 | 166 | ||