<commit_before># Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

(($) ->
  "use strict"
  $(document).on 'click', '[data-enable-url]', () ->
    $.ajax(
      url: $(@).data('enable-url')
      method: 'POST'
      dataType: 'json'
      success: (data) =>
        $(@).toggleClass 'active'
        $(@).find('.map-background-by-default').toggleClass('hide')

        if data.new_default?
          $(@).find('.map-background-by-default.active').removeClass('active')
          $('.map-backgrounds-viewport').find("[data-id=#{data.new_default}]").find('.map-background-by-default').addClass('active')

    )

  $(document).on 'ajax:success', ".map-background-by-default", () ->
    $('.map-background-by-default.active').removeClass('active')
    $(@).toggleClass 'active'

  $(document).on 'ajax:success', ".map-background-delete a", () ->
    $(@).closest('.map-background-container').remove()


  return
) jQuery<commit_msg>Fixes default map toggle. Fixes #1620.<commit_after># Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

(($) ->
  "use strict"
  $(document).on 'click', '[data-enable-url]', () ->
    $.ajax(
      url: $(@).data('enable-url')
      method: 'POST'
      dataType: 'json'
      success: (data) =>
        $(@).toggleClass 'active'
        $(@).find('.map-layer-by-default').toggleClass('hide')

        if data.new_default?
          $(@).find('.map-layer-by-default.active').removeClass('active')
          $('.map-layers-viewport').find("[data-id=#{data.new_default}]").find('.map-layer-by-default').addClass('active')

    )

  $(document).on 'ajax:success', ".map-layer-by-default", () ->
    $('.map-layer-by-default.active').removeClass('active')
    $(@).toggleClass 'active'

  $(document).on 'ajax:success', ".map-layer-delete a", () ->
    $(@).closest('.map-layer-container').remove()


  return
) jQuery
{'fraction_non_alphanumeric': 0.207582061950994, 'fraction_numerical': 0.0018492834026814608, 'mean_word_length': 3.328, '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': '6340967', 'n_tokens_mistral': 672, 'n_tokens_neox': 663, 'n_words': 132}