<commit_before>###

Drop - Finally a dropdown which understands where it is.

    - Attach to 8 different locations
    - Attach options diagram:

            topLeft  topRight
                 |    |
       leftTop --TARGET-- rightTop
    leftBottom --TARGET-- rightBottom
                 |    |
          bottomLeft bottomRight

###


$ = jQuery
isIE = not not /msie [\w.]+/.exec navigator.userAgent.toLowerCase()


# Extracted from jQuery UI Core (to remove dependency)
# https://github.com/jquery/jquery-ui/blob/24756a978a977d7abbef5e5bce403837a01d964f/ui/jquery.ui.core.js#L60
$.fn.extend
    scrollParent: ->
        scrollParent = undefined

        if (isIE and (/(static|relative)/).test(@css('position'))) or (/absolute/).test(@css('position'))
            scrollParent = @parents().filter(->
                (/(relative|absolute|fixed)/).test($.css(this, 'position')) and (/(auto|scroll)/).test($.css(this, 'overflow') + $.css(this, 'overflow-y') + $.css(this, 'overflow-x'))
            ).eq(0)

        else
            scrollParent = @parents().filter(->
                (/(auto|scroll)/).test $.css(this, 'overflow') + $.css(this, 'overflow-y') + $.css(this, 'overflow-x')
            ).eq(0)

        return (/fixed/).test(this.css('position')) or (if not scrollParent.length then $('html') else scrollParent)

debounce = 0
if isIE
    debounce = 100

$ ->

    drop.updateBodyClasses()

    $(document).on 'openDrop.drop, closeDrop.drop', (event) -> drop.updateBodyClasses()

    resizePending = false
    $(window).on 'resize', ->
        return if resizePending

        resizePending = true
        setTimeout ->
            resizePending = false
            $.each drop.dropTargets, (i, $target) ->
                if $target.drop 'isOpened'
                    $target.drop 'positionDrop'<commit_msg>Cleanup debounce time<commit_after>###

Drop - Finally a dropdown which understands where it is.

    - Attach to 8 different locations
    - Attach options diagram:

            topLeft  topRight
                 |    |
       leftTop --TARGET-- rightTop
    leftBottom --TARGET-- rightBottom
                 |    |
          bottomLeft bottomRight

###


$ = jQuery
isIE = not not /msie [\w.]+/.exec navigator.userAgent.toLowerCase()
debounce = if isIE then 100 else 0


# Extracted from jQuery UI Core (to remove dependency)
# https://github.com/jquery/jquery-ui/blob/24756a978a977d7abbef5e5bce403837a01d964f/ui/jquery.ui.core.js#L60
$.fn.extend
    scrollParent: ->
        scrollParent = undefined

        if (isIE and (/(static|relative)/).test(@css('position'))) or (/absolute/).test(@css('position'))
            scrollParent = @parents().filter(->
                (/(relative|absolute|fixed)/).test($.css(this, 'position')) and (/(auto|scroll)/).test($.css(this, 'overflow') + $.css(this, 'overflow-y') + $.css(this, 'overflow-x'))
            ).eq(0)

        else
            scrollParent = @parents().filter(->
                (/(auto|scroll)/).test $.css(this, 'overflow') + $.css(this, 'overflow-y') + $.css(this, 'overflow-x')
            ).eq(0)

        return (/fixed/).test(this.css('position')) or (if not scrollParent.length then $('html') else scrollParent)


$ ->

    drop.updateBodyClasses()

    $(document).on 'openDrop.drop, closeDrop.drop', (event) -> drop.updateBodyClasses()

    resizePending = false
    $(window).on 'resize', ->
        return if resizePending

        resizePending = true
        setTimeout ->
            resizePending = false
            $.each drop.dropTargets, (i, $target) ->
                if $target.drop 'isOpened'
                    $target.drop 'positionDrop'
{'fraction_non_alphanumeric': 0.15483694162784326, 'fraction_numerical': 0.018635242532200603, 'mean_word_length': 2.279424977538185, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 2, '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': '6758691', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1075, 'n_words': 242}