Sha256: 03370b9075c71fa526665f1d1afbaf2e1d7693bc3f3a0d3dd676953eff13af7d

Contents?: true

Size: 1.91 KB

Versions: 6

Compression:

Stored size: 1.91 KB

Contents

//= require jquery
//= require jquery_ujs
//= require active_admin/base

$(function() {
  $('#sidebar').click(function (e) {
    var position = $(this).position();
    var width = $(this).width();
    if (e.pageX < position.left) {
      if ($(this).css('right') == '0px') {
        $(this).css('position', 'fixed');
        $(this).animate({
          right: "-="+width
        }, 600, function() {
          animationFilterDone = true;
        });
      } else {
        $(this).animate({
          right: "+="+width
        }, 600, function() {
          $(this).css('position', 'absolute');
          animationFilterDone = true;
        });
      }
    }
  });

  var animationDone = true;
  $('#utility_nav').click(function (e) {
    var position = $(this).position();
    var tabs = $('#tabs');
    var width = Math.round(tabs[0].getBoundingClientRect().width);

    if (e.pageX < (position.left + 40)) {
      if(animationDone == true) {
        animationDone = false;
        if (tabs.css('left') == '0px') {
          tabs.animate({
            left: "-="+width
          }, 400, function() {
            animationDone = true;
          });
        } else {
          tabs.animate({
            left: "+="+width
          }, 400, function() {
            animationDone = true;
          });
        }
      }
    }
  });

  $('body').click(function (e) {
    var tabs = $('#tabs');
    var width = Math.round(tabs[0].getBoundingClientRect().width);
    if (tabs.css('left') == '0px') {
      if (e.pageX > width && e.pageY > 60) {
        if(animationDone == true) {
          animationDone = false;
          tabs.animate({
            left: "-="+width
          }, 400, function() {
            animationDone = true;
          });
        }
      }
    }
  });

  $('#tabs .has_nested').click(function (e) {
    if ($(this).hasClass('open') == true) {
      $(this).removeClass('open');
    } else {
      $(this).addClass('open');
    }
  });
});

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
arctic_admin-1.4.2 app/assets/javascripts/arctic_admin/base.js
arctic_admin-1.4.1 app/assets/javascripts/arctic_admin/base.js
arctic_admin-1.4.0 app/assets/javascripts/arctic_admin/base.js
arctic_admin-1.3.3 app/assets/javascripts/arctic_admin/base.js
arctic_admin-1.3.2 app/assets/javascripts/arctic_admin/base.js
arctic_admin-1.3.1 app/assets/javascripts/arctic_admin/base.js