Giter Site home page Giter Site logo

Comments (6)

holger1411 avatar holger1411 commented on May 23, 2024

Yeah I know, problem is that I don´t wan´t to include another 3rd party script just in case someone want to use the (optional) tooltip component in BS4 (the theme itself don´t us it). Even the BS4 sample demos don´t use it (and you will see the JS message...). And it seems the tether script must be loaded as extra script...it did not work if I compile it into the theme.min.js file along with BS4.

My problem is that the theme has to do another extra request and load another 23kb script...without any usage for 99.99% of all visitors.

But if I remove the tooltip component from BS4 the dropdown function did not work anymore...seems it use some snippets from this component.

Because BS4 is still in Alpha stadium I could live with it, hoping they found another solution/way for it.
If you found it let me know!

Child as dependency?
The child theme ist not a dependency from the parent theme, but the parent theme is already a dependency from the child theme;-)

The child uses a lot of stuff from the parent, but the parent don´t use anything from the child.
Or with other words: The child theme "depends" on the parent, but the parent did not "depend" on the child.

from understrap.

diegoversiani avatar diegoversiani commented on May 23, 2024

Ok. I'm not gonna use tooltips for this project either but my scripts don't work because of that. It works if I use bootstrap sprockets and do not load tooltips component.

I think it would be good to remove tooltips by default from the parent project and put info in the readme file on both projects.
It will prevent problems like mine. What you think?

Child as dependency?

No. Sorry for the confusion, I was really tired when I wrote that haha.
I meant to put Tether as a dependency in the parent project, but forget that, you already gave reasons not to =D

from understrap.

diegoversiani avatar diegoversiani commented on May 23, 2024

Here is what I changed in gulpfile.js to compile my scripts:
https://github.com/dvlopes/understrap-child/blob/jveventos/gulpfile.js#L91

from understrap.

holger1411 avatar holger1411 commented on May 23, 2024

Problem is if I don´t compile the BS tooltip.js file into it, the dropdown menu stops working and I receive this error:
TypeError: r.default is undefined

As far as I could see it you override (or simulate) the BS dropdown function by your own js, right?
Might be an option, but isnt the cleanest one, too for a theme framework.

There are ongoing discussions in the BS4 forums/git repo about managing theter as dependency. Will wait a bit till they found there direction...

from understrap.

holger1411 avatar holger1411 commented on May 23, 2024

Found a solution. Seems the problem was that I try to compile the tether.min.js into the theme.min.js file. If I add the Tether script as dependency and compile the non-minified tether.js before Bootstrap.js it seems to work. See changes here:
862fd60

Means I don´t need another request for theter and the error message is gone, but the theme.min.js file will be about 20kb bigger. Its not a perfect tradeoff but better than nothing...

from understrap.

diegoversiani avatar diegoversiani commented on May 23, 2024

As far as I could see it you override (or simulate) the BS dropdown function by your own js, right?
Might be an option, but isnt the cleanest one, too for a theme framework.

Yeah, I didn't consider using BS dropdown because it is for a sidebar menu, but I'll try it later on this project.

With the new release v0.4.3 the script is compiling and working well. Thx

from understrap.

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.