mdbootstrap / material-design-for-bootstrap

Important! A new UI Kit version for Bootstrap 5 is available. Access the latest free version via the link below.
https://mdbootstrap.com/docs/standard/
MIT License
9.34k stars 1.15k forks source link

MDB does not work on nw.js #146

Closed micsanbr closed 4 years ago

micsanbr commented 6 years ago

MDB PRO works fine in the browser (Chrome) but breaks and becomes totally unusable with NW.JS (tested on 28.2). Uncaught ReferenceError: Waves is not defined at mdb.min.js:1

The only workaround I've found is to comment out "mdb.min.js" and load each required javascript component individually, except the "waves" component which is causing the issue.

Is it possible to fix this one properly? Thanks!

Current workaround:

<!--
<script src="js/mdb.min.js"></script>
-->
<script src="js/modules/vendor/enhanced-modals.js"></script>
<script src="js/modules/vendor/hammer.js"></script>
<script src="js/modules/vendor/jarallax.js"></script>
<script src="js/modules/vendor/jarallax-video.js"></script>
<script src="js/modules/vendor/jquery.easing.js"></script>
<script src="js/modules/vendor/jquery.hammer.js"></script>
<script src="js/modules/vendor/jquery.sticky.js"></script>
<script src="js/modules/vendor/scrollbar.js"></script>
<script src="js/modules/vendor/toastr.js"></script>
<script src="js/modules/vendor/velocity.min.js"></script>
<script src="js/modules/vendor/wow.js"></script>
<!--
<script src="js/modules/vendor/waves.js"></script>
-->
<script src="js/modules/dist/buttons.js"></script>
<script src="js/modules/dist/collapsible.js"></script>
<script src="js/modules/dist/scrolling-navbar.js"></script>
<script src="js/modules/dist/sidenav.js"></script>
<script src="js/modules/dist/cards.js"></script>
<script src="js/modules/dist/dropdown.js"></script>
<script src="js/modules/dist/file-input.js"></script>
<script src="js/modules/dist/material-select.js"></script>
<script src="js/modules/dist/mdb-autocomplete.js"></script>
<script src="js/modules/dist/range-input.js"></script>
<script src="js/modules/dist/smooth-scroll.js"></script>
micsanbr commented 6 years ago

This one should clarify what the problem (and the solution) are: https://github.com/fians/Waves/issues/131#issuecomment-242016999

JStrebeyko commented 6 years ago

Testing components with nw.js is not part of the development process, so thanks big time for letting is know! Added to TODO

micsanbr commented 6 years ago

You are welcome. I think the fix should be easy to implement too.

micsanbr commented 6 years ago

Hello, any plans on fixing this? It's just a matter of replacing typeof global === 'object' ? global : this with typeof window === 'object' ? window : this

PiotrObrebski commented 5 years ago

Your solution will be implemented in the new release in version 4.8.6. Thank you for contribution.

micsanbr commented 5 years ago

14 months later ... :-D