<commit_before>class App.UiElement.textarea
  @render: (attribute) ->
    fileUploaderId = 'file-uploader-' + new Date().getTime() + '-' + Math.floor( Math.random() * 99999 )
    item = $( App.view('generic/textarea')( attribute: attribute ) + '<div class="file-uploader ' + attribute.class + '" id="' + fileUploaderId + '"></div>' )

    a = =>
      visible = $( item[0] ).is(":visible")
      if visible && !$( item[0] ).expanding('active')
        $( item[0] ).expanding()
      $( item[0] ).on('focus', ->
        visible = $( item[0] ).is(":visible")
        if visible && !$( item[0] ).expanding('active')
          $( item[0] ).expanding().focus()
      )
    App.Delay.set( a, 80 )

    if attribute.upload

      # add file uploader
      u = =>
        # only add upload item if html element exists
        if @el.find('#' + fileUploaderId )[0]
          @el.find('#' + fileUploaderId ).fineUploader(
            request:
              endpoint: App.Config.get('api_path') + '/ticket_attachment_upload'
              params:
                form_id: @form_id
            text:
              uploadButton: '<i class="glyphicon glyphicon-paperclip"></i>'
            template: '<div class="qq-uploader">' +
                        '<pre class="btn qq-upload-icon qq-upload-drop-area"><span>{dragZoneText}</span></pre>' +
                        '<div class="btn btn-default qq-upload-icon2 qq-upload-button pull-right" style="">{uploadButtonText}</div>' +
                        '<ul class="qq-upload-list span5" style="margin-top: 10px;"></ul>' +
                      '</div>',
            classes:
              success: ''
              fail:    ''
            debug: false
          )
      App.Delay.set( u, 100, undefined, 'form_upload' )
    item<commit_msg>Fixed @el issue.<commit_after>class App.UiElement.textarea
  @render: (attribute) ->
    fileUploaderId = 'file-uploader-' + new Date().getTime() + '-' + Math.floor( Math.random() * 99999 )
    item = $( App.view('generic/textarea')( attribute: attribute ) + '<div class="file-uploader ' + attribute.class + '" id="' + fileUploaderId + '"></div>' )

    a = =>
      visible = $( item[0] ).is(":visible")
      if visible && !$( item[0] ).expanding('active')
        $( item[0] ).expanding()
      $( item[0] ).on('focus', ->
        visible = $( item[0] ).is(":visible")
        if visible && !$( item[0] ).expanding('active')
          $( item[0] ).expanding().focus()
      )
    App.Delay.set( a, 80 )

    if attribute.upload

      # add file uploader
      u = =>

        # only add upload item if html element exists
        if $('#' + fileUploaderId )[0]
          $('#' + fileUploaderId ).fineUploader(
            request:
              endpoint: App.Config.get('api_path') + '/ticket_attachment_upload'
              params:
                form_id: @form_id
            text:
              uploadButton: '<svg class="icon icon-paperclip"><use xlink:href="#icon-paperclip"></use></svg>'
            template: '<div class="qq-uploader">' +
                        '<pre class="btn qq-upload-icon qq-upload-drop-area"><span>{dragZoneText}</span></pre>' +
                        '<div class="btn btn-default qq-upload-icon2 qq-upload-button pull-right" style="">{uploadButtonText}</div>' +
                        '<ul class="qq-upload-list span5" style="margin-top: 10px;"></ul>' +
                      '</div>',
            classes:
              success: ''
              fail:    ''
            debug: false
          )
      App.Delay.set( u, 100, undefined, 'form_upload' )
    item
{'fraction_non_alphanumeric': 0.17813199105145414, 'fraction_numerical': 0.012304250559284116, 'mean_word_length': 1.975873544093178, 'pattern_counts': {'":': 4, '<': 33, '<?xml version=': 0, '>': 41, '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': '2497889', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1055, 'n_words': 218}