Sha256: 73e998eafb095a964ef668629c033a430fa95ab72d01315aba8cd6ee00069ce6

Contents?: true

Size: 1.25 KB

Versions: 4

Compression:

Stored size: 1.25 KB

Contents

var CoreLayout = (function () {

  function _initToggleProfileMenu () {
    $('.layout-admin__profile-container').click(function () {
      // close header widgets
      $('.layout-admin__widget-container').removeClass('layout-admin__widget-container--active')
      // toggle class on profile menu
      $('.layout-admin__profile-menu-list').toggleClass('layout-admin__profile-menu-list--active')
    })
  }

  function _initToggleWidget () {
    $('.layout-admin__widget-button').click(function (e) {
      var widgetContainer = $(this).parent()
      // close profile menu
      $('.layout-admin__profile-menu-list').removeClass('layout-admin__profile-menu-list--active')
      // close others widgets and toggle on clicked widget
      if ($(widgetContainer).hasClass('layout-admin__widget-container--active')) {
        $('.layout-admin__widget-container').removeClass('layout-admin__widget-container--active')
      } else {
        $('.layout-admin__widget-container').removeClass('layout-admin__widget-container--active')
        $(widgetContainer).addClass('layout-admin__widget-container--active')
      }
      e.preventDefault()
    })
  }

  // Init:
  function init () {
    _initToggleProfileMenu()
    _initToggleWidget()
  }

  return {
    init: init
  }

})()

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lato_core-2.2.2 app/assets/javascripts/lato_core/modules/CoreLayout.js
lato_core-2.2.0 app/assets/javascripts/lato_core/modules/CoreLayout.js
lato_core-2.1.4 app/assets/javascripts/lato_core/modules/CoreLayout.js
lato_core-2.1.3 app/assets/javascripts/lato_core/modules/CoreLayout.js