Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
Switch works on double click | ROR

I am using a switch (something like toggle button) to show some data to the users. But the switch only works on double click instead of single.

Below is the code from .js file -

var integrations = {
    init: function() {
      $("input[type='checkbox'].integration").bootstrapSwitch();

      $("input[type='checkbox'].integration").on('switchChange.bootstrapSwitch', function(e, state) {
        $(this).siblings('.bootstrap-switch-label').click();
        var val = $("input[type='checkbox'].integration").val()
        if (val === 'true')
          $(this).prop( "checked", true);
        else
          $(this).prop( "checked", false);
      });

      this.jiraService = w.service.get('jira').init();
      this.jiraService.initEvents();

      if (w.Clipboard) {
        new w.Clipboard(".copy.tooltip-right");
      }
    }
  };

Does anyone know how to make it work for single click? Please help!

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Can you check by commenting out below line, it might be possible that label is also making the switch click.

$(this).siblings('.bootstrap-switch-label').click(); 
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!