Sha256: 34811d5192aa2cb63fd5a952f023ddeaa891e53537ef5c2a2a8358172e3d0e8a

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

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;
  });

  $('#more_photo_options_field #toggle_advanced_options').click(function(e){
    e.preventDefault();
    $('#more_options').animate({opacity: 'toggle', height: 'toggle'}, 250);

    $('html,body').animate({
      scrollTop: $('#toggle_advanced_options').parent().offset().top
    }, 250);
  });

  $(".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.2.0 app/assets/javascripts/refinery/photo_gallery/admin/photo_gallery.js.erb