customizer-controls-toggle.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /**
  2. * Customizer controls toggles
  3. *
  4. * @package Astra
  5. */
  6. ( function( $ ) {
  7. /**
  8. * Trigger hooks
  9. */
  10. ASTControlTrigger = {
  11. /**
  12. * Trigger a hook.
  13. *
  14. * @since 1.0.0
  15. * @method triggerHook
  16. * @param {String} hook The hook to trigger.
  17. * @param {Array} args An array of args to pass to the hook.
  18. */
  19. triggerHook: function( hook, args )
  20. {
  21. $( 'body' ).trigger( 'astra-control-trigger.' + hook, args );
  22. },
  23. /**
  24. * Add a hook.
  25. *
  26. * @since 1.0.0
  27. * @method addHook
  28. * @param {String} hook The hook to add.
  29. * @param {Function} callback A function to call when the hook is triggered.
  30. */
  31. addHook: function( hook, callback )
  32. {
  33. $( 'body' ).on( 'astra-control-trigger.' + hook, callback );
  34. },
  35. /**
  36. * Remove a hook.
  37. *
  38. * @since 1.0.0
  39. * @method removeHook
  40. * @param {String} hook The hook to remove.
  41. * @param {Function} callback The callback function to remove.
  42. */
  43. removeHook: function( hook, callback )
  44. {
  45. $( 'body' ).off( 'astra-control-trigger.' + hook, callback );
  46. },
  47. };
  48. /**
  49. * Helper class that contains data for showing and hiding controls.
  50. *
  51. * @since 1.0.0
  52. * @class ASTCustomizerToggles
  53. */
  54. ASTCustomizerToggles = {
  55. 'astra-settings[display-site-title-responsive]' : [],
  56. 'astra-settings[display-site-tagline-responsive]' : [],
  57. 'astra-settings[ast-header-retina-logo]' :[],
  58. 'custom_logo' : [],
  59. /**
  60. * Section - Header
  61. *
  62. * @link ?autofocus[section]=section-header
  63. */
  64. /**
  65. * Layout 2
  66. */
  67. // Layout 2 > Right Section > Text / HTML
  68. // Layout 2 > Right Section > Search Type
  69. // Layout 2 > Right Section > Search Type > Search Box Type.
  70. 'astra-settings[header-main-rt-section]' : [],
  71. 'astra-settings[hide-custom-menu-mobile]' :[],
  72. /**
  73. * Blog
  74. */
  75. 'astra-settings[blog-width]' :[],
  76. 'astra-settings[blog-post-structure]' :[],
  77. /**
  78. * Blog Single
  79. */
  80. 'astra-settings[blog-single-post-structure]' : [],
  81. 'astra-settings[blog-single-width]' : [],
  82. 'astra-settings[blog-single-meta]' :[],
  83. /**
  84. * Small Footer
  85. */
  86. 'astra-settings[footer-sml-layout]' : [],
  87. 'astra-settings[footer-sml-section-1]' :[],
  88. 'astra-settings[footer-sml-section-2]' :[],
  89. 'astra-settings[footer-sml-divider]' :[],
  90. 'astra-settings[header-main-sep]' :[],
  91. 'astra-settings[disable-primary-nav]' :[],
  92. /**
  93. * Footer Widgets
  94. */
  95. 'astra-settings[footer-adv]' :[],
  96. 'astra-settings[shop-archive-width]' :[],
  97. 'astra-settings[mobile-header-logo]' :[],
  98. 'astra-settings[different-mobile-logo]' :[],
  99. };
  100. } )( jQuery );