Comments (5)
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.
@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
from angular-joyride.
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.
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.
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)
- TypeError Cannot read property 'afterStep' of undefined HOT 6
- Documentation doesn't explain how to use afterStep. HOT 3
- Joyride positioned off the screen HOT 2
- Joyride positioned offscreen (#2) HOT 3
- Responsive should allow different selector HOT 1
- Translation for Skip, Prev and Next buttons
- Cannot read property 'beforeStep' / 'afterStep' of undefined HOT 4
- Feature Request: template like templateUrl HOT 7
- Step transitions aren't working HOT 1
- IT'S NOT WORKING WITH ANGULAR 22
- The joyride's popup does not work HOT 5
- Popup is scroll to the top of page, causing some of the highlighted content to overflow from the screen HOT 3
- jr_overlay present on top of document after reload HOT 7
- Steps section wont allow for dynamically loaded array HOT 1
- Feature request HOT 2
- Missing license
- Links on joyride step HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-joyride.