Skip to content

Commit

Permalink
Fixes for Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
stephband committed May 19, 2022
1 parent 505c404 commit 0360a13
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 29 deletions.
6 changes: 3 additions & 3 deletions build/slide-show-figure.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/slide-show-ol.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/slide-show-shadow.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions build/slide-show-ul.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/slide-show.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions build/slide-show.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/docs.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/docs.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions modules/active.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ function getAligned(scroller, elements) {

// If position has crossed the detection going left, we're in the money
if (x <= detection) {
console.log(x, detection, slide);
break;
}
}
Expand All @@ -120,7 +119,7 @@ export function updateActive(data) {
const { scroller, children, elements } = data;
const current = getAligned(scroller, elements);
let active;
console.log('CURRENT', current);

// If current is a loop ghost jump to the actual slide it references
if (!current) { return; }
if (isGhost(current)) {
Expand Down
3 changes: 1 addition & 2 deletions modules/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Emitted by a slide when it is brought into scroll-snap alignment.
export default {
construct: function(shadow) {
// Shadow DOM
const slides = create('slot', { part: 'slides', style: 'display: grid;' });
const slides = create('slot', { part: 'slides' });
const scroller = create('div', { class: 'scroller', children: [slides] });
const controls = create('nav', { part: 'controls', children: [
create('slot', { name: 'controls' })
Expand Down Expand Up @@ -104,7 +104,6 @@ export default {
))
.filter((child) => (data.active !== child && trigger('slide-active', child)))
.map((child) => data.active = child)
.log('ACTIVE')
.broadcast({ memory: true, hot: true });

const clicks = events('click', shadow)
Expand Down
11 changes: 5 additions & 6 deletions test/2-slide-show.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</head>

<body>
<!--pre>&lt;slide-show loop autoplay controls="navigation pagination fullscreen"&gt; - one child</pre>
<pre>&lt;slide-show loop autoplay controls="navigation pagination fullscreen"&gt; - one child</pre>

<slide-show loop autoplay controls="navigation pagination fullscreen">
<img src="../docs/images/bourg.jpg" draggable="false" />
Expand All @@ -81,7 +81,7 @@
<a href="/" draggable="false" id="summit"><img src="../docs/images/summit.jpg" draggable="false" /></a>
</slide-show>

<pre>&lt;slide-show loop autoplay controls="navigation pagination fullscreen"&gt; - one child</pre-->
<pre>&lt;slide-show loop autoplay controls="navigation pagination fullscreen"&gt; - one child</pre>

<slide-show class="main-slide-show" loop autoplay controls="navigation pagination fullscreen" active="#mauverin">
<a href="/" draggable="false"><img src="../docs/images/donkeys.jpg" draggable="false" /></a>
Expand All @@ -91,7 +91,7 @@
<a href="/" draggable="false"><img src="../docs/images/summit.jpg" draggable="false" /></a>
</slide-show>

<!--slide-show class="tab-slide-show">
<slide-show class="tab-slide-show">
<a class="tab-button button" href="#1" draggable="false">Explore</a>
<a class="tab-button button active" href="#2" draggable="false">Buy</a>
<a class="tab-button button" href="#3" draggable="false">Free trial</a>
Expand Down Expand Up @@ -141,7 +141,7 @@
<img src="../docs/images/bourg.jpg" draggable="false" />
<img src="../docs/images/tractor.jpg" draggable="false" />
<img src="../docs/images/bourg.jpg" draggable="false" />
</slide-show-->
</slide-show>

<script type="module">
import '../slide-show.js';
Expand All @@ -156,7 +156,7 @@


// -----
/*

test(0, 'create <slide-show> with no children', (done) => {
const show = document.createElement('slide-show');
done(show);
Expand Down Expand Up @@ -305,7 +305,6 @@
)
);
}, true);
*/
</script>
</body>
</html>

0 comments on commit 0360a13

Please sign in to comment.