File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 290
290
291
291
parts : {
292
292
image : 'img' ,
293
- caption : 'figcaption' ,
294
- link : 'a'
293
+ caption : 'figcaption'
294
+ // parts# link defined in widget#init
295
295
} ,
296
296
297
297
// The name of this widget's dialog.
370
370
lock : this . ready ? helpers . checkHasNaturalRatio ( image ) : true
371
371
} ;
372
372
373
+ // If we used 'a' in widget#parts definition, it could happen that
374
+ // selected element is a child of widget.parts#caption. Since there's no clever
375
+ // way to solve it with CSS selectors, it's done like that. (#11783).
376
+ this . parts . link = this . element . is ( 'a' ) ?
377
+ this . element : this . element . getFirst ( function ( el ) {
378
+ return el . is ( 'a' ) ;
379
+ } ) ;
380
+
373
381
// Depending on configuration, read style/class from element and
374
382
// then remove it. Removed style/class will be set on wrapper in #data listener.
375
383
// Note: Center alignment is detected during upcast, so only left/right cases
You can’t perform that action at this time.
0 commit comments