featherlight icon indicating copy to clipboard operation
featherlight copied to clipboard

Mixed content html/img/iframe galleries don't use the correct filter type

Open chris-twiner opened this issue 4 years ago • 2 comments

What kind of issue is this? (put 'x' between the square brackets)

  • [ ] Question. This issue tracker is not the place for questions. If you want to ask how to do something, or to understand why something isn't working the way you expect it to, use http://stackoverflow.com/questions/ask . Provide working code, starting from http://jsfiddle.net/JNsu6/15/. We monitor the tag featherlight.js.

  • [ ] Bug report. If you’ve found a bug, you must provide a minimal example in a CodePen, starting from http://jsfiddle.net/JNsu6/15/ . will do later..

  • [ ] Feature Request. Make sure there's no good way to do what you want first; consider asking on http://stackoverflow.com/questions/ask first.

Inserting the following to featherlight.js line 227:

if (data === '' && !filter) {
  var typeValue = readTargetAttr('data-featherlight-type');
  data = typeValue || '';
}

allows attributes to use the data-featherlight-type to bind when directly clicked the correct type and during gallery navigation when started from another 'slide'. Noticeable in the case of this attribute being iframe as ajax is the default contentFilter it will load the entire iframe page and insert the elements directly instead of an iframe when navigated to.

chris-twiner avatar Sep 14 '21 20:09 chris-twiner

apologies for an incomplete ticket, I didn't want to forget to raise it. I'll add the example later.

chris-twiner avatar Sep 14 '21 20:09 chris-twiner

found further inconsistent handling of mixed galleries, (could still be an rtfm issue of course):

var typeValue = readTargetAttr('data-featherlight-type');
if ( (data === '' && typeValue) &&
   (!filter || !(filter === filters[typeValue]))) {
    data = typeValue;
    filter = undefined;
}

chris-twiner avatar Sep 15 '21 16:09 chris-twiner