Sha256: 3e5d24b0b46c422c70f17c5485fddad63d111e8e81e2b14d966d58c051c0c882

Contents?: true

Size: 1.46 KB

Versions: 5

Compression:

Stored size: 1.46 KB

Contents

//= require jquery
//= require jquery_ujs
//= require modernizr
//= require spin.min
//= require twitter/bootstrap/dropdown
//= require twitter/bootstrap/modal
//= require twitter/bootstrap/button
//= require fastclick.min_
//= require video.min
//= require_tree .

function resizeFix() {
  if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
    var viewportmeta = document.querySelector('meta[name="viewport"]');
    if (viewportmeta) {
      viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';
      document.body.addEventListener('gesturestart', function () {
        viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6';
      }, false);
    }
  }
}

function setLoading(selector, element, options) {
  var div = $('<div></div>').addClass('loadingAction');
  $(element).find(selector).html(div);
  new Spinner(options).spin(div[0]);
}

function visitLocation(element) {
  window.location = $(element).find('a').attr('href');
}

$(document).ready(function() {
  resizeFix();

  if (Modernizr.touch) {
    new FastClick(document.body);
  }

  $('.outline tr').on('click', function() {
    setLoading('td:first-child', this, {
      lines: 9,
      radius: 3,
      length: 4,
      width: 2
    });
    visitLocation(this);
  });

  $('.content-item').on('click', function() {
    setLoading('.content-item-image a', this, {
      width: 3
    });

    visitLocation(this);
  });

});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
woople-theme-0.2.15 app/assets/javascripts/woople-theme/theme.js
woople-theme-0.2.14 app/assets/javascripts/woople-theme/theme.js
woople-theme-0.2.13 app/assets/javascripts/woople-theme/theme.js
woople-theme-0.2.12 app/assets/javascripts/woople-theme/theme.js
woople-theme-0.2.11 app/assets/javascripts/woople-theme/theme.js