tutorcruncher / socket-frontend

Javascript frontend for TutorCruncher Socket

Home Page:https://tutorcruncher.com/features/tutorcruncher-socket/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

better use of event_callback

samuelcolvin opened this issue · comments

use event_callback more, eg. when opening the enquiry modal.

Use case:

    socket('{{ site.socket_key }}', {
      mode: 'enquiry-modal',
      element: '#socket-enquiry-modal',
      router_mode: 'history',
      event_callback: function() {
        console.log('socket event callback')
        $('[name="client_email"]').each(function(){
          $(this).attr('placeholder', 'Email (Required)')
          $(this).attr('required', 'required')
        })
      }
    })

cc @sam-jenkins