@@ -12,33 +12,34 @@ export class ReplaceMediaOption extends BaseOptionComponent {
12
12
}
13
13
canSetLink ( editingElement ) {
14
14
return (
15
- this . isImageSupportedForStyle ( editingElement ) &&
15
+ isImageSupportedForStyle ( editingElement ) &&
16
16
! searchSupportedParentLinkEl ( editingElement ) . matches ( "a[data-oe-xpath]" )
17
17
) ;
18
18
}
19
19
hasHref ( editingElement ) {
20
20
const parentEl = searchSupportedParentLinkEl ( editingElement ) ;
21
21
return parentEl . tagName === "A" && parentEl . hasAttribute ( "href" ) ;
22
22
}
23
- isImageSupportedForStyle ( img ) {
24
- if ( ! img . parentElement ) {
25
- return false ;
26
- }
23
+ }
24
+
25
+ export function isImageSupportedForStyle ( img ) {
26
+ if ( ! img . parentElement ) {
27
+ return false ;
28
+ }
27
29
28
- // See also `[data-oe-type='image'] > img` added as data-exclude of some
29
- // snippet options.
30
- const isTFieldImg = "oeType" in img . parentElement . dataset ;
30
+ // See also `[data-oe-type='image'] > img` added as data-exclude of some
31
+ // snippet options.
32
+ const isTFieldImg = "oeType" in img . parentElement . dataset ;
31
33
32
- // Editable root elements are technically *potentially* supported here (if
33
- // the edited attributes are not computed inside the related view, they
34
- // could technically be saved... but as we cannot tell the computed ones
35
- // apart from the "static" ones, we choose to not support edition at all in
36
- // those "root" cases).
37
- // See also `[data-oe-xpath]` added as data-exclude of some snippet options.
38
- const isEditableRootElement = "oeXpath" in img . dataset ;
34
+ // Editable root elements are technically *potentially* supported here (if
35
+ // the edited attributes are not computed inside the related view, they
36
+ // could technically be saved... but as we cannot tell the computed ones
37
+ // apart from the "static" ones, we choose to not support edition at all in
38
+ // those "root" cases).
39
+ // See also `[data-oe-xpath]` added as data-exclude of some snippet options.
40
+ const isEditableRootElement = "oeXpath" in img . dataset ;
39
41
40
- return ! isTFieldImg && ! isEditableRootElement ;
41
- }
42
+ return ! isTFieldImg && ! isEditableRootElement ;
42
43
}
43
44
44
45
export function searchSupportedParentLinkEl ( editingElement ) {
0 commit comments