mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 18:15:25 +08:00
351e8e2359
In Safari, clicking any image in a lightbox gallery results in the first image loading (instead of the clicked image). Previously we relied on document.activeElement to determine which lightbox image was clicked. However in Chrome the active element is the lightbox selector (a.lightbox), whereas in Safari the active element defaults to the body tag. Currently the startingIndex that is calculated within processHTML() is used by lightbox to determine which image to load first. The starting index is currently achieved by checking each lightbox element within the gallery against the active element. To fix this issue we can use the event.target to get the clicked image, then use the closest selector and pass that into the function to do the matching and return the correct startingIndex. |
||
---|---|---|
.. | ||
admin | ||
bootstrap-json | ||
confirm-new-email | ||
deprecation-silencer | ||
dialog-holder | ||
discourse | ||
discourse-common | ||
discourse-hbr | ||
discourse-plugins | ||
discourse-widget-hbs | ||
docs | ||
ember-addons | ||
ember-cli-progress-ci | ||
ember-production-deprecations | ||
locales | ||
patches | ||
pretty-text | ||
select-kit | ||
truth-helpers | ||
wizard | ||
.licensee.json | ||
.npmrc | ||
discourse-js-processor.js | ||
handlebars-shim.js | ||
package.json | ||
polyfills.js | ||
service-worker.js.erb | ||
yarn.lock |