Projet

Général

Profil

Paste
Télécharger (1,92 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / adaptivetheme / at_subtheme / scripts / media_queries.js @ 74f6bef0

1
/**
2
 * @file
3
 * Fire callbacks for media query breakpoints
4
 *
5
 * To use this file enable the OnMediaQuery.js polyfill in your subthemes
6
 * appearance settings - this will load the required plugin and this file.
7
 *
8
 * This allows you to write context (media query) specific JS without hard
9
 * coding the media queries, aka like matchMedia. Each context matches the
10
 * media queries you set in theme settings (by adding the font-family
11
 * declarations to the responsive layout CSS).
12
 *
13
 * SEE: https://github.com/JoshBarr/js-media-queries
14
 *
15
 * IMPORTANT: do not rename or move this file, or change the directory name!
16
 */
17
var queries = [
18

    
19
  /*
20
   * Smalltouch
21
   */
22
  {
23
    context: ['smalltouch_portrait', 'smalltouch_landscape'], // portrait and landscape
24
    call_in_each_context: false,
25
    callback: function() {
26
      // console.log('smalltouch');
27

    
28
      // Example: this will remove the search block in smartphones
29
      // el = document.getElementById("block-search-form");
30
      // el.parentNode.removeChild(element);
31
    }
32
  },
33
  {
34
    context: 'smalltouch_portrait', // portrait only
35
    callback: function() {
36
      //console.log('smalltouch portrait');
37
    }
38
  },
39
  {
40
    context: 'smalltouch_landscape', // landscape only
41
    callback: function() {
42
      //console.log('smalltouch_landscape ');
43
    }
44
  },
45

    
46

    
47
  /*
48
   * Tablet
49
   */
50
  {
51
    context: ['tablet_portrait', 'tablet_landscape'], // portrait and landscape
52
    call_in_each_context: false,
53
    callback: function() {
54
      //console.log('tablet');
55
    }
56
  },
57
  {
58
    context: 'tablet_portrait', // portrait only
59
    callback: function() {
60
      //console.log('tablet_portrait');
61
    }
62
  },
63
  {
64
    context: 'tablet_landscape', // landscape only
65
    callback: function() {
66
      //console.log("tablet_landscape");
67
    }
68
  },
69

    
70

    
71
  /*
72
   * Standard desktop layout
73
   */
74
  {
75
    context: 'standard',
76
    callback: function() {
77
      //console.log("standard desktop");
78
    }
79
  },
80
];
81

    
82
MQ.init(queries);