Sha256: 306820e3895be507787d3317e29ba6e209b9a6fd8cd8330e065579c05665b427

Contents?: true

Size: 970 Bytes

Versions: 1

Compression:

Stored size: 970 Bytes

Contents

<%# encoding: utf-8 %>

$(function() {
  $('form#form_edit_photos').on("click", ".form-photo-field .form-actions-right .confirm-delete", function() {
    if ( confirm( $(this).attr('data-confirm') ) ) {
      $.ajax({
        type: "POST",
        dataType: 'script',
        data: { '_method': 'delete' },
        url: this.href
      });
    }

    //TODO if all fields are deleted, show info - 0 photos and dont show form actions

    return false;
  });

  $(".chzn-select").chosen(
      {
        no_results_text: "<%= I18n.t('chosen.no_results') %>"
      }
  );


  $(".chzn-select-deselect").chosen({
    no_results_text: "<%=  I18n.t('chosen.no_results') %>",
    allow_single_deselect:true}
  );


  $('#photo_gallery_wym_editation').on("click", ".form-actions .button", function() {

    $.ajax({
      type: "POST",
      dataType: 'script',
      data: { '_method': $(this).attr('data-method') },
      url: this.href
    });

    return false;
  });

});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
refinerycms-photo-gallery-0.3.0 app/assets/javascripts/refinery/photo_gallery/admin/photo_gallery.js.erb