Closed lukos closed 3 months ago
Actually, I do think it breaks my loop which fails as soon as the first slider is setup, meaning the remaining sliders are not wired up at all!
Hi, actually this is happening because the Slider.js module requires 2 dependencies.
If you navigate to where the modules are saved in the repo, 4X/Modules and open Slider.js, you will see "Required dependencies: CurrentDevice.js, Dragdealer.js"
These are listed in the order they need to be loaded.
I don't recommend removing that from the Slider code since it makes a difference for cross-device support.
Is this something that could be added to the online docs? Again, happy to make a PR.
Yes of course, it can certainly be added to the online docs.
I appreciate the PR offer, but it might be faster for me to do it since I know where everything connects, and if I add this in one place I need to add it everywhere.
By online docs, are you referring to the primary page for each widget type? E.G. https://whatsock.com/Templates/Sliders/
Can you think of anywhere else where this would be good to add?
Thanks again, Bryan
Hi Bryan, yes, that's where I was thinking of putting it, just a section that says, "Slider depends on....". I think this is helpful as well since i noticed there were a number of drag JS files in the distribution so it wouldn't otherwise be obvious which ones to use (unless I looked into the JS file like you suggested!).
No problem, I'll add a section for all the widgets and hopefully have this done by the end of this week. :)
Hi, I added the new required module data to all of the primary widget pages. You can see this within the JavaScript Syntax section. (This seemed the most logical place to put it.) The repo has been updated as with the live site.
I also did some markup maintenance and didn't realize my code prettifier has been broken for ages so everything got updated. I don't think I broke anything, but please let me know if anything looks or acts weird.
Closing this issue as completed.
Slider.js
has code which queries window.device.type, which is undefined on my desktop Chrome so it errors in the console. I'm not sure whether this breaks anything other than the code inside the if statement but presumably easy enough to checktypeof(window.device) !== "undefined"
before checking for the device type?Again, happy to do a PR if you are happy with the proposed change.