Blame view

bower_components/Materialize/js/global.js 1.01 KB
a1a3bc73   Luigi Serra   graphs updates
1
2
3
4
5
6
7
8
9
  // Required for Meteor package, the use of window prevents export by Meteor
  (function(window){
    if(window.Package){
      Materialize = {};
    } else {
      window.Materialize = {};
    }
  })(window);
  
74249687   Luigi Serra   Cross browser con...
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  
  // Unique ID
  Materialize.guid = (function() {
    function s4() {
      return Math.floor((1 + Math.random()) * 0x10000)
        .toString(16)
        .substring(1);
    }
    return function() {
      return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
             s4() + '-' + s4() + s4() + s4();
    };
  })();
  
  Materialize.elementOrParentIsFixed = function(element) {
      var $element = $(element);
      var $checkElements = $element.add($element.parents());
      var isFixed = false;
      $checkElements.each(function(){
          if ($(this).css("position") === "fixed") {
              isFixed = true;
              return false;
          }
      });
      return isFixed;
  };
  
  // Velocity has conflicts when loaded with jQuery, this will check for it
  var Vel;
  if ($) {
    Vel = $.Velocity;
a1a3bc73   Luigi Serra   graphs updates
41
42
43
  } else if (jQuery) {
    Vel = jQuery.Velocity;
  } else {
74249687   Luigi Serra   Cross browser con...
44
45
    Vel = Velocity;
  }