Sha256: a5131fd1123cf2154a6b6103973f8373fed563b606a5f2ed4660c357e00a0454

Contents?: true

Size: 1.61 KB

Versions: 82

Compression:

Stored size: 1.61 KB

Contents

Festivity.Performances = {
  bindEvents: function() {
    this.bindEvents();
  },

  bindEvents: function() {
    $('#add-performance').click(function(e){
      e.preventDefault();
      Festivity.Performances.addPerformance($(this).attr('href'), $(this).attr('data-id'));
    });
    Festivity.Performances.bindDateTimeMask();
    Festivity.Performances.bindDeleteEvents();

  },
  bindDateTimeMask: function() {
    $(".date_field").inputmask("festivitydatetime12");
  },
  bindDeleteEvents: function() {
    $('a.festivity-delete-performance').unbind('click');
    $('a.festivity-delete-performance').click(function(e){
      e.preventDefault();
      if (confirm("Are you sure you want to delete this performance?")){
        $.ajax({
          url: $(this).attr('href'),
          type: "DELETE",
          success: function(data, textStatus, jqXHR) {
            Festivity.Performances.updatePerformancesTable(data);
          }
        });
      }
    });
  },

  addPerformance: function(url, event_page_id){
    $.ajax({
      url: url,
      type: "POST",
      data: {
        event_page_id: event_page_id
      },
      success: function(data, textStatus, jqXHR) {
        Festivity.Performances.addPerformanceRow(data);
      }
    });
  },

  addPerformanceRow: function(data) {
    $("#festivity-performances-table").append(data);
    Festivity.Performances.bindDateTimeMask();
    Festivity.Performances.bindDeleteEvents();
  },

  updatePerformancesTable: function(data) {
    $("#festivity-performances-table").replaceWith(data);
    Festivity.Performances.bindDateTimeMask();
    Festivity.Performances.bindDeleteEvents();
  }

};

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.6.3 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.6.2 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.6.1 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.6 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.19 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.18 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.17 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.16 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.15 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.14 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.13 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.12 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.11 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.10 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.9 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.8 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.7 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.6 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.5 app/assets/javascripts/admin/pages/performances.js
trusty-festivity-extension-2.5.4 app/assets/javascripts/admin/pages/performances.js