app-contact.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //[app contact Javascript]
  2. //Project: Riday Admin - Responsive Admin Template
  3. //Primary use: Used only for the Data Table
  4. $(function () {
  5. "use strict";
  6. //Enable iCheck plugin for checkboxes
  7. //iCheck for checkbox and radio inputs
  8. $('.media-list input[type="checkbox"]').iCheck({
  9. checkboxClass: 'icheckbox_flat-blue',
  10. radioClass: 'iradio_flat-blue'
  11. });
  12. //Enable check and uncheck all functionality
  13. $(".checkbox-toggle").click(function () {
  14. var clicks = $(this).data('clicks');
  15. if (clicks) {
  16. //Uncheck all checkboxes
  17. $(".media-list input[type='checkbox']").iCheck("uncheck");
  18. $(".ion", this).removeClass("ion-android-checkbox-outline").addClass('ion-android-checkbox-outline-blank');
  19. } else {
  20. //Check all checkboxes
  21. $(".media-list input[type='checkbox']").iCheck("check");
  22. $(".ion", this).removeClass("ion-android-checkbox-outline-blank").addClass('ion-android-checkbox-outline');
  23. }
  24. $(this).data("clicks", !clicks);
  25. });
  26. //Handle starring for glyphicon and font awesome
  27. $(".app-contact-star").click(function (e) {
  28. e.preventDefault();
  29. //detect type
  30. var $this = $(this).find("a > i");
  31. var glyph = $this.hasClass("glyphicon");
  32. var fa = $this.hasClass("fa");
  33. //Switch states
  34. if (glyph) {
  35. $this.toggleClass("glyphicon-star");
  36. $this.toggleClass("glyphicon-star-empty");
  37. }
  38. if (fa) {
  39. $this.toggleClass("fa-star");
  40. $this.toggleClass("fa-star-o");
  41. }
  42. });
  43. }); // End of use strict