<commit_before>KDView = require './../../core/view.coffee'

module.exports = class KDTabPaneView extends KDView

  constructor:(options = {},data)->

    options.hiddenHandle  ?= no      # a Boolean
    options.name         or= ""      # a String
    options.detachable    ?= yes
    defaultCssClass        = "kdtabpaneview kdhiddentab #{KD.utils.slugify options.name.toLowerCase()} clearfix"
    options.cssClass       = KD.utils.curry defaultCssClass, options.cssClass

    super options, data

    @name = options.name
    @lastScrollTops =
      parent        : 0
      self          : 0


    @on 'KDTabPaneActive',        @bound 'setMainView'
    @on 'KDTabPaneLazyViewAdded', @bound 'fireLazyCallback'


  show:->

    if @getOption 'detachable'
      @parent?.getElement().appendChild @getElement()

    @unsetClass 'kdhiddentab'
    @setClass 'active'

    @active = yes
    @emit 'KDTabPaneActive'

    @applyScrollTops()


  hide:->

    return  unless @active

    @setScrollTops()

    @unsetClass 'active'
    @setClass 'kdhiddentab'

    if @getOption 'detachable'
      @parent?.getElement().removeChild @getElement()

    @active = no
    @emit 'KDTabPaneInactive'<commit_msg>TabView: fixes emitting inactive event order<commit_after>KDView = require './../../core/view.coffee'

module.exports = class KDTabPaneView extends KDView

  constructor:(options = {},data)->

    options.hiddenHandle  ?= no      # a Boolean
    options.name         or= ""      # a String
    options.detachable    ?= yes
    defaultCssClass        = "kdtabpaneview kdhiddentab #{KD.utils.slugify options.name.toLowerCase()} clearfix"
    options.cssClass       = KD.utils.curry defaultCssClass, options.cssClass

    super options, data

    @name = options.name
    @lastScrollTops =
      parent        : 0
      self          : 0


    @on 'KDTabPaneActive',        @bound 'setMainView'
    @on 'KDTabPaneLazyViewAdded', @bound 'fireLazyCallback'


  show:->

    if @getOption 'detachable'
      @parent?.getElement().appendChild @getElement()

    @unsetClass 'kdhiddentab'
    @setClass 'active'

    @active = yes
    @emit 'KDTabPaneActive'

    @applyScrollTops()


  hide:->

    return  unless @active

    @setScrollTops()
    @emit 'KDTabPaneInactive'

    @unsetClass 'active'
    @setClass 'kdhiddentab'

    if @getOption 'detachable'
      @parent?.getElement().removeChild @getElement()

    @active = no
{'fraction_non_alphanumeric': 0.11460488208522962, 'fraction_numerical': 0.0016549441456350847, 'mean_word_length': 2.6636363636363636, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4137722', 'n_tokens_mistral': 809, 'n_tokens_neox': 749, 'n_words': 166}