Sha256: c706637a6f81c7ffef78287ff9c58a378d6f302314189d31261876b1c76fff1a

Contents?: true

Size: 1.36 KB

Versions: 5

Compression:

Stored size: 1.36 KB

Contents

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
//= require bootstrap-sprockets

$(document).ready( function () {
  
  $('.password-check').change(function () {
    if (this.value == $('.password').val()) {
      $(this).parent().removeClass('has-error');
      $(this).parent().addClass('has-success');
      $('.submit-btn').removeAttr('disabled');
    } else {
      $(this).parent().addClass('has-error');
      $('.submit-btn').attr({'disabled':'disabled'});
    }
  });
  
  // this bit checks if the edit_page is rendered, if so by default disable the password check
  edit_page = $('#edit_page').hasClass('edit_page');
  if (edit_page) { 
      $(this).parent().removeClass('has-error');
      $(this).parent().addClass('has-success');
      $('.submit-btn').removeAttr('disabled');
  }
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cally-2.0.0 app/assets/javascripts/cally/application.js
cally-1.0.3 app/assets/javascripts/cally/application.js
cally-1.0.2 app/assets/javascripts/cally/application.js
cally-1.0.1 app/assets/javascripts/cally/application.js
cally-1.0.0 app/assets/javascripts/cally/application.js