bespokejs / bespoke

DIY Presentation Micro-Framework

Home Page:http://markdalgleish.com/projects/bespoke.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query About Dynamically Adding Slides

LucyintheSkyWithDiamonds opened this issue · comments

Hello! :)

I am looking to use bespoke.js as part of a Google Chrome Extension I am building, in which the user uses bespoke.js to open new tabs as new slides, rather than new tabs in the browser.

$("#1").on("click", "a", function(event) {
event.preventDefault(); 
var the_url = $(this).attr("href");
console.log(the_url);
$("#1").after("<section></section>");
var the_section = $("#1").next("section");
$.get(the_url, function(data) {
the_section.html(data);
function init() {
        deck = bespoke.from('article');
    }
    init();
});
});

This works, and I see the new slide, but the problem is, I can't tab to it. As in, it is there, but I can't use the arrow keys to navigate to it, it is just a static slide.

I'm using the demo.js and bespoke.min from your homepage.

Please assist with this and advise if possible.

Images of my problem here:

1st

Here I have the first two slides in my DOM when the page loads, section id = 1 and another empty section. I can tab across these two as I should with ease:

2nd

But when I click a link to generate a new slide from $("#1") - I get this, I can see the new slide, but I can't tab to it, I can only tab to the empty section that was already there:

3rd

4th

I can't get to The Kingdom of Dragak's slide. I can see it, but can't use the arrow keys to get to it. I just get stuck with this:

5th

How do I fix that, if possible?

Thank you for your time and for this awesome presentation library.

Sorry, this feature isn't supported by the framework and I don't have any plans to add support any time soon, if at all, as it is beyond the scope of the problem I'm trying to solve. Having to account for the number of slides changing would increase the burden on all plugin authors, forcing them to account for this edge case.