Sha256: def1dcbf7620a215945891e33d4c1df5d4165bce38be5f509ce1c54bdb42620a

Contents?: true

Size: 1.93 KB

Versions: 18

Compression:

Stored size: 1.93 KB

Contents

jQuery.fn.extend
  overlaySlot: ->
    oslot = @closest(".card-slot._overlay")
    return oslot if oslot[0]?
    oslot = @closest(".overlay-container").find("._overlay")
    oslot[0]? && $(oslot[0])

  addOverlay: (overlay, $slotter) ->
    if @parent().hasClass("overlay-container")
      if $(overlay).hasClass("_stack-overlay")
        @before overlay
      else
        $("._overlay-origin").removeClass("_overlay-origin")
        @replaceOverlay(overlay)
    else
      #@find(".tinymce-textarea").each ->
      #  tinymce.remove("##{$(this).attr("id")}")
      #  #tinyMCE.execCommand('mceRemoveControl', false, $(this).attr("id"))
      if @parent().hasClass("_overlay-container-placeholder")
        @parent().addClass("overlay-container")
      else
        @wrapAll('<div class="overlay-container">')
      @addClass("_bottomlay-slot")
      @before overlay

    $slotter.registerAsOrigin("overlay", overlay)
    decko.contentLoaded(overlay, $slotter)

  replaceOverlay: (overlay) ->
    @overlaySlot().trigger "slotDestroy"
    @overlaySlot().replaceWith overlay
    $(".bridge-sidebar .tab-pane:not(.active) .bridge-pills > .nav-item > .nav-link.active").removeClass("active")

  isInOverlay: ->
    return @closest(".card-slot._overlay").length

  removeOverlay: () ->
      slot = @overlaySlot()
      if slot
        slot.removeOverlaySlot()

  removeOverlaySlot: () ->
    @trigger "slotDestroy"
    if @siblings().length == 1
      bottomlay = $(@siblings()[0])
      if bottomlay.hasClass("_bottomlay-slot")
        if bottomlay.parent().hasClass("_overlay-container-placeholder")
          bottomlay.parent().removeClass("overlay-container")
        else
          bottomlay.unwrap()
        bottomlay.removeClass("_bottomlay-slot").updateBridge(true, bottomlay)

        #bottomlay.find(".tinymce-textarea").each ->
        #  tinymce.EditorManager.execCommand('mceAddControl',true, editor_id);
        #  decko.initTinyMCE($(this).attr("id"))

    @remove()

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
card-mod-script-0.13.2 assets/script/decko/overlay.js.coffee
card-mod-script-0.11.7 lib/javascript/decko/overlay.js.coffee
card-mod-script-0.12.0 lib/javascript/decko/overlay.js.coffee
card-mod-script-0.11.6 lib/javascript/decko/overlay.js.coffee
card-mod-script-0.11.5 lib/javascript/decko/overlay.js.coffee
card-mod-script-0.11.4 lib/javascript/decko/overlay.js.coffee
card-mod-script-0.11.3 lib/javascript/decko/overlay.js.coffee
card-mod-script-0.11.2 lib/javascript/decko/overlay.js.coffee
card-mod-script-0.11.1 lib/javascript/decko/overlay.js.coffee
card-mod-script-0.11.0 lib/javascript/decko/overlay.js.coffee
card-1.100.0 mod/machines/lib/javascript/decko/overlay.js.coffee
card-1.99.6 mod/machines/lib/javascript/decko/overlay.js.coffee
card-1.99.5 mod/machines/lib/javascript/decko/overlay.js.coffee
card-1.99.4 mod/machines/lib/javascript/decko/overlay.js.coffee
card-1.99.3 mod/machines/lib/javascript/decko/overlay.js.coffee
card-1.99.2 mod/machines/lib/javascript/decko/overlay.js.coffee
card-1.99.1 mod/machines/lib/javascript/decko/overlay.js.coffee
card-1.99.0 mod/machines/lib/javascript/decko/overlay.js.coffee