Sha256: 1fb7cba4df607097f5bab151c68e61223904eaaf3bc098f69f1745c14177c821

Contents?: true

Size: 1.41 KB

Versions: 3

Compression:

Stored size: 1.41 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

3 entries across 3 versions & 1 rubygems

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