Giter Site home page Giter Site logo

Comments (5)

ahmed-wagdi avatar ahmed-wagdi commented on May 22, 2024

I don't quite see the need for this. If the selector isn't found then either a) The developer misspelled it, in which case the current version handles it fine (switches to the default step type and logs a warning for the developer). Or b) there are certain cases where the element is dynamically removed from the DOM, in which case you have access to the steps array and you can manipulate it as you like.

If this is causing a problem for more people and there are cases where handling it manually gets tedious then I'll work on implementing it.

from angular-joyride.

Deklin avatar Deklin commented on May 22, 2024

@ahmed-wagdi that is not quite true, the selector may not be around due to ng-if changes, ng-class changes based on certain UI conditions, OR the selector (when using :visible) may not be visible due to responsive layout changes.

Here is an example on how I handled it using angular-ui-tour

benmarch/angular-ui-tour#141

from angular-joyride.

ahmed-wagdi avatar ahmed-wagdi commented on May 22, 2024

Yes but most of these cases can be handled manually by the developer. Not to mention that there are too many "what if" cases to handle, for example:

  • The very first step has a non-existent selector, have to handle the cases for entering this step for both starting the joyride and previous button being used.
  • Selector does exist but element is hidden using css.
  • Step with the non-existent selector also contains a beforeStep function that needs to be executed (for example closing a modal)
  • What if instead of navigating using next/previous buttons, the step was opened using the goTo method, what should happen then?

And more i probably haven't thought of. As it is right now it might require you to write more code to handle these cases but atleast it gives you the flexibility to handle it in the way that best suites your app.

It is possible to implement this feature but it would overcomplicate the code base and the only way i can think of implementing this wouldn't be very efficient. I also don't think that the cases where the missing element is constantly being toggled (which might make it a bit more tiring to handle manually) are very common, usually the elements that are highlighted in the joyride are key elements on the page that don't change often.

from angular-joyride.

Deklin avatar Deklin commented on May 22, 2024

No problem, thank you for the consideration.

A lot of this could be solved using jquery selectors and skip if no match, that wouldn't overcomplicate it but would require you to support jquery selectors (optionally if jquery exists perhaps)

from angular-joyride.

ahmed-wagdi avatar ahmed-wagdi commented on May 22, 2024

Ya i want to avoid including jquery but it wouldn't really solve it anyway, just instead of:
if(!$(element_selector).length)
i would do this:
if(!document.querySelector(element_selector))
That's not really the problem. I'm closing this for now but if more people have the same problem and it can't be solved easily with custom code then i'll reopen it.

from angular-joyride.

Related Issues (18)

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.