Sha256: ef931589569a3fb4b61cf57ac0269f987c1e677affb278fd4bf305044a00f4e4

Contents?: true

Size: 528 Bytes

Versions: 1

Compression:

Stored size: 528 Bytes

Contents

this.simpleBind = function() {
  $('input:text').keyup(function() {
    var id = $(this).data('bind');
    $("[bind='" + id + "']").html($(this).val());
  });

  $('select').change(function() {
    var id = $(this).data('bind');
    $("[bind='" + id + "']").html($(this).find("option:selected").text());
  });
};

if (typeof defined === "function" ? defined(Turbolinks) : void 0) {
  $(document).on('turbolinks:load', function() {
    simpleBind();
  });
} else {
  $(document).on('ready', function() {
    simpleBind();
  });
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_bind-0.1.1 app/assets/javascripts/simple_bind.js