 
     @_hideLess() if @length is 1
 
-    addHandler window, 'resize', =>
-      image = @images[@current]
-      @updateDimensions image.width, image.height
+    addHandler window, 'resize', @_onResize
 
     @open cid
     @

    for ev in event
      target.addEventListener ev, listener, false

removeHandler = (element, event, selector) ->
  target = getTarget element, selector
  ###
  if target?
    listeners = getEventListeners target
    unless event instanceof Array
      event = [event]
    for ev in event
      for listener in listeners[ev]
        target.removeEventListener ev, listener, false
  ###

hasClassList = (element, selector) ->
  target = getTarget element, selector

      throw "You don't have defaultOptions or templates variables"
      return false

    @options = merge defaultOptions, options

    ###
     Подготовка шаблонов
