rating-init.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /******/ (function() { // webpackBootstrap
  2. var __webpack_exports__ = {};
  3. /*!*******************************************!*\
  4. !*** ./resources/js/pages/rating-init.js ***!
  5. \*******************************************/
  6. /*
  7. Template Name: Skote - Admin & Dashboard Template
  8. Author: Themesbrand
  9. Website: https://themesbrand.com/
  10. Contact: themesbrand@gmail.com
  11. File: Rating Js File
  12. */
  13. $(function () {
  14. $('input.check').on('change', function () {
  15. alert('Rating: ' + $(this).val());
  16. });
  17. $('.rating-tooltip').rating({
  18. extendSymbol: function extendSymbol(rate) {
  19. $(this).tooltip({
  20. container: 'body',
  21. placement: 'bottom',
  22. title: 'Rate ' + rate
  23. });
  24. }
  25. });
  26. $('.rating-tooltip-manual').rating({
  27. extendSymbol: function extendSymbol() {
  28. var _title;
  29. $(this).tooltip({
  30. container: 'body',
  31. placement: 'bottom',
  32. trigger: 'manual',
  33. title: function title() {
  34. return _title;
  35. }
  36. });
  37. $(this).on('rating.rateenter', function (e, rate) {
  38. _title = rate;
  39. $(this).tooltip('show');
  40. }).on('rating.rateleave', function () {
  41. $(this).tooltip('hide');
  42. });
  43. }
  44. });
  45. $('.rating').each(function () {
  46. $('<span class="badge bg-info"></span>').text($(this).val() || '').insertAfter(this);
  47. });
  48. $('.rating').on('change', function () {
  49. $(this).next('.badge').text($(this).val());
  50. });
  51. });
  52. /******/ })()
  53. ;