Giter Club home page Giter Club logo

Comments (9)

benmarch avatar benmarch commented on May 27, 2024

Interesting, I haven't seen this error before. Can you paste in some relevant markup?

from angular-bootstrap-tour.

valerypilyavets avatar valerypilyavets commented on May 27, 2024

Well, markup is very simple. The html part is:

<div tour template-url="components/tour.html"></div>

components/tour.html is accessible, and successfully loaded via AJAX, I can see it in developer tools.

jquery version is 1.11.1 (I already tried 1.9.0 and 1.11.3)
angular version is 1.4.0 (and it's not easy to change it, I think)

Error appears after tour.restart(true) is triggered. The message I have in console:

Uncaught TypeError: Cannot read property 'ownerDocument' of undefined
ga.contains @ jquery.js:1468
m.extend.clone @ jquery.js:5515
(anonymous function) @ jquery.js:5843
(anonymous function) @ jquery.js:141
m.extend.map @ jquery.js:503
m.fn.m.map @ jquery.js:140
m.fn.extend.clone @ jquery.js:5842
Tour._showPopover @ bootstrap-tour-standalone.js:1049
(anonymous function) @ bootstrap-tour-standalone.js:879
(anonymous function) @ bootstrap-tour-standalone.js:1127
d.complete @ jquery.js:7474j @ jquery.js:3148
k.fireWith @ jquery.js:3260i @ jquery.js:7350
m.fx.tick @ jquery.js:7639

from angular-bootstrap-tour.

benmarch avatar benmarch commented on May 27, 2024

Is it making the request for the template, or is the template loaded into $templateCache already? Can you paste the template here?

from angular-bootstrap-tour.

valerypilyavets avatar valerypilyavets commented on May 27, 2024

It makes a request for template when page is loading. So, when tour is triggered, it is already in $templateCache. I can to get it with $templateCache.get('components/tour.html').

The template code is the same as the default bootstrap tour tempate

<div class="popover tour">
    <div class="arrow"></div>
    <h3 class="popover-title"></h3>
    <div class="popover-content"></div>
    <div class="popover-navigation">
        <button class="btn btn-default" data-role="prev">« Prev</button>
        <span data-role="separator">|</span>
        <button class="btn btn-default" data-role="next">Next »</button>
    </div>
    <button class="btn btn-default" data-role="end">End tour</button>
    </nav>
</div>

from angular-bootstrap-tour.

benmarch avatar benmarch commented on May 27, 2024

I'm not sure if this is the problem, but you have a dangling tag at the bottom. It looks very similar to the one I'm using in production right now, and the setup is identical, so I'm a little surprised it's not working (unless that is causing a parse error). If that doesn't fix it, can you try setting a breakpoint in the TourHelpers where it loads the template and just see if the template is being loaded? It would be: https://github.com/benmarch/angular-bootstrap-tour/blob/master/app/tour_helpers.js#L56

from angular-bootstrap-tour.

valerypilyavets avatar valerypilyavets commented on May 27, 2024

Breakpoint information:

template: "<div class="popover tour">↵    <div class="arrow"></div>↵    <h3 class="popover-title"></h3>↵  <div class="popover-content"></div>↵  <div class="popover-navigation">↵     <button class="btn btn-default" data-role="prev">« Prev</button>↵        <span data-role="separator">|</span>↵     <button class="btn btn-default" data-role="next">Next »</button>↵    </div>↵   <button class="btn btn-default" data-role="end">End tour</button>↵</div>"

So I think it is loaded

from angular-bootstrap-tour.

benmarch avatar benmarch commented on May 27, 2024

I'm still not really sure what would cause this. The line that is failing is $template.clone().wrap("<div>").parent().html(), and $template is just $(step.template). I would recommend setting a breakpoint around that line (bootstrap-tour-standalone.js#1049) and stepping into the jquery clone function. It looks like when it gets to #contains() the context is undefined, but I'm not familiar enough with jquery to know why that would happen. From some of the SO threads i found, this might have something to do with a classname clash somewhere on your page, but that's a total shot in the dark. Sorry I can't do more to help you here, let me know if you find out anything else.

from angular-bootstrap-tour.

benmarch avatar benmarch commented on May 27, 2024

Actually, @valerypilyavets, can you try updating to version 0.3.4-rc.2 and let me know if that works for you?

from angular-bootstrap-tour.

benmarch avatar benmarch commented on May 27, 2024

Should be fixed as of 0.3.4. If not, please let me know. Thanks!

from angular-bootstrap-tour.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.