app/assets/javascripts/refinery/photo_gallery/admin/photo_gallery.js.erb in refinerycms-photo-gallery-0.1.2 vs app/assets/javascripts/refinery/photo_gallery/admin/photo_gallery.js.erb in refinerycms-photo-gallery-0.2.0

- old
+ new

@@ -1,53 +1,53 @@ <%# 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 - }); - } + $('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 + //TODO if all fields are deleted, show info - 0 photos and dont show form actions - return false; - }); + return false; + }); - $('#more_photo_options_field #toggle_advanced_options').click(function(e){ - e.preventDefault(); - $('#more_options').animate({opacity: 'toggle', height: 'toggle'}, 250); + $('#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); - }); + $('html,body').animate({ + scrollTop: $('#toggle_advanced_options').parent().offset().top + }, 250); + }); - $(".chzn-select").chosen( - { - no_results_text: "<%= I18n.t('chosen.no_results') %>" - } - ); + $(".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} - ); + $(".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() { + $('#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; + $.ajax({ + type: "POST", + dataType: 'script', + data: { '_method': $(this).attr('data-method') }, + url: this.href }); + + return false; + }); }); \ No newline at end of file