<commit_before>jQuery ->
  window.CancelPopupManager = new CancelPopupManager
class CancelPopupManager
  constructor: ->
    master = this
    @popup = $("#cancel-popup")
    return if @popup.length == 0
    $("body").on("click", ".bar-info", (event)->
      element = $(this)
      room_element = element.parent().parent()
      master.reservation_id = element.data("id")
      return unless master.reservation_id?
      # Truncate start/end times to 10 minute mark.
      @start_time = moment(element.data("start")).tz("America/Los_Angeles")
      @end_time = moment(element.data("end")).tz("America/Los_Angeles")
      # Set up popup.
      master.position_popup(event.pageX, event.pageY)
      master.populate_cancel_popup(room_element, @start_time, @end_time, element)
      event.stopPropagation()
    )
    @popup.click (event) ->
      event.stopPropagation() unless $(event.target).data("remote")?
    @popup.on("touchend", (event) =>
      event.stopPropagation() unless $(event.target).data("remote")?
    )
    # Bind popup closers
    this.bind_popup_closers()
    # Bind Ajax Events
    this.bind_ajax_events()<commit_msg>Prevent cancel popup from dissapearing.<commit_after>jQuery ->
  window.CancelPopupManager = new CancelPopupManager
class CancelPopupManager
  constructor: ->
    master = this
    @popup = $("#cancel-popup")
    return if @popup.length == 0
    $("body").on("click", ".bar-info", (event)->
      element = $(this)
      room_element = element.parent().parent()
      master.reservation_id = element.data("id")
      return unless master.reservation_id?
      # Truncate start/end times to 10 minute mark.
      @start_time = moment(element.data("start")).tz("America/Los_Angeles")
      @end_time = moment(element.data("end")).tz("America/Los_Angeles")
      # Set up popup.
      master.position_popup(event.pageX, event.pageY)
      master.populate_cancel_popup(room_element, @start_time, @end_time, element)
      event.stopPropagation()
      event.preventDefault()
    )
    @popup.click (event) ->
      event.stopPropagation() unless $(event.target).data("remote")?
    @popup.on("touchend", (event) =>
      event.stopPropagation() unless $(event.target).data("remote")?
    )
    # Bind popup closers
    this.bind_popup_closers()
    # Bind Ajax Events
    this.bind_ajax_events()
{'fraction_non_alphanumeric': 0.1452513966480447, 'fraction_numerical': 0.002578427159432746, 'mean_word_length': 3.476923076923077, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5315983', 'n_tokens_mistral': 733, 'n_tokens_neox': 732, 'n_words': 136}