diff options
author | Johann-S <johann.servoire@gmail.com> | 2018-11-14 14:02:18 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2019-02-20 23:05:45 +0300 |
commit | 661db08eeb4db1f5d3a155e58646d61f3e206b5d (patch) | |
tree | 0c84d536ac7c633734630e910786ee2134d4e18c /js/tests/visual/toast.html | |
parent | 5e068eeda9155e19663578a005383ce1da7fd1a6 (diff) |
rewrite toast plugin without jquery
Diffstat (limited to 'js/tests/visual/toast.html')
-rw-r--r-- | js/tests/visual/toast.html | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/js/tests/visual/toast.html b/js/tests/visual/toast.html index 93a627cc55..a527eab13d 100644 --- a/js/tests/visual/toast.html +++ b/js/tests/visual/toast.html @@ -52,19 +52,34 @@ </div> </div> + <script src="../../dist/dom/polyfill.js"></script> <script src="../../dist/util.js"></script> + <script src="../../dist/dom/manipulator.js"></script> + <script src="../../dist/dom/data.js"></script> + <script src="../../dist/dom/eventHandler.js"></script> <script src="../../dist/toast.js"></script> <script> - $(function () { - $('.toast').toast() + window.addEventListener('load', function () { + Util.makeArray(document.querySelectorAll('.toast')) + .forEach(function (toastNode) { + new Toast(toastNode) + }) - $('#btnShowToast').on('click', function () { - $('.toast').toast('show') - }) + document.getElementById('btnShowToast').addEventListener('click', function () { + Util.makeArray(document.querySelectorAll('.toast')) + .forEach(function (toastNode) { + var toast = Toast._getInstance(toastNode) + toast.show() + }) + }) - $('#btnHideToast').on('click', function () { - $('.toast').toast('hide') - }) + document.getElementById('btnHideToast').addEventListener('click', function () { + Util.makeArray(document.querySelectorAll('.toast')) + .forEach(function (toastNode) { + var toast = Toast._getInstance(toastNode) + toast.hide() + }) + }) }) </script> </body> |