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 85ad3d82 Assos Assos
/**
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 74f6bef0 Assos Assos
 * SEE: https://github.com/JoshBarr/js-media-queries
14 85ad3d82 Assos Assos
 *
15
 * IMPORTANT: do not rename or move this file, or change the directory name!
16
 */
17
var queries = [
18
19 74f6bef0 Assos Assos
  /*
20
   * Smalltouch
21
   */
22 85ad3d82 Assos Assos
  {
23 74f6bef0 Assos Assos
    context: ['smalltouch_portrait', 'smalltouch_landscape'], // portrait and landscape
24 85ad3d82 Assos Assos
    call_in_each_context: false,
25
    callback: function() {
26 74f6bef0 Assos Assos
      // 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 85ad3d82 Assos Assos
    }
32
  },
33
  {
34 74f6bef0 Assos Assos
    context: 'smalltouch_portrait', // portrait only
35 85ad3d82 Assos Assos
    callback: function() {
36 74f6bef0 Assos Assos
      //console.log('smalltouch portrait');
37 85ad3d82 Assos Assos
    }
38
  },
39
  {
40 74f6bef0 Assos Assos
    context: 'smalltouch_landscape', // landscape only
41 85ad3d82 Assos Assos
    callback: function() {
42 74f6bef0 Assos Assos
      //console.log('smalltouch_landscape ');
43 85ad3d82 Assos Assos
    }
44
  },
45
46
47 74f6bef0 Assos Assos
  /*
48
   * Tablet
49
   */
50 85ad3d82 Assos Assos
  {
51 74f6bef0 Assos Assos
    context: ['tablet_portrait', 'tablet_landscape'], // portrait and landscape
52 85ad3d82 Assos Assos
    call_in_each_context: false,
53
    callback: function() {
54 74f6bef0 Assos Assos
      //console.log('tablet');
55 85ad3d82 Assos Assos
    }
56
  },
57
  {
58 74f6bef0 Assos Assos
    context: 'tablet_portrait', // portrait only
59 85ad3d82 Assos Assos
    callback: function() {
60 74f6bef0 Assos Assos
      //console.log('tablet_portrait');
61 85ad3d82 Assos Assos
    }
62
  },
63
  {
64 74f6bef0 Assos Assos
    context: 'tablet_landscape', // landscape only
65 85ad3d82 Assos Assos
    callback: function() {
66 74f6bef0 Assos Assos
      //console.log("tablet_landscape");
67 85ad3d82 Assos Assos
    }
68
  },
69
70
71 74f6bef0 Assos Assos
  /*
72
   * Standard desktop layout
73
   */
74 85ad3d82 Assos Assos
  {
75
    context: 'standard',
76
    callback: function() {
77 74f6bef0 Assos Assos
      //console.log("standard desktop");
78 85ad3d82 Assos Assos
    }
79
  },
80
];
81
82
MQ.init(queries);