       $(@)[method] 'choco-hide'
 
       _this.updateDimensions current.width, current.height if current
-
-    if isStorage and not @thumbnails.hasClass 'choco-hide'
+    , '.choco-thumbnails-toggle'
+
+    if isStorage and not hasClass @thumbnails, 'choco-hide'
       status = localStorage.getItem('choco-thumbnails') or 1
-      @overlay.find('.choco-thumbnails-toggle').trigger 'click' if toInt(status) is 0
+      $(@overlay).find('.choco-thumbnails-toggle').trigger 'click' if toInt(status) is 0
 
     @
 

    @

  close: ->
    if @overlay.hasClass 'choco-show'
      history.pushState null, null, '#' if isHistory

      if @options.thumbnails
        @thumbnails.html ''
        @overlay.find('.choco-thumbnails-toggle').off 'click'

      $(window).off 'resize'

      @current = null
      @overlay.removeClass 'choco-show'
      $('body').removeClass 'choco-body'
    @

  open: (cid, updateHistory) ->

  if support is false
    support = true for prefix in prefixes when element.style[prefix + 'AnimationName'] isnt undefined

  addClass document.querySelector('html'), 'cssanimations' if support is true
  support

# Экспорт в глобальное пространство
