SHOW:
|
|
- or go back to the newest paste.
1 | /* global meny */ | |
2 | import Ember from 'ember'; | |
3 | ||
4 | ||
5 | export default Ember.View.extend({ | |
6 | ||
7 | templatename: "sidebar", | |
8 | createMeny: function(){ | |
9 | ||
10 | console.log("Hello"); | |
11 | var menu = meny.Meny.create({ | |
12 | // The element that will be animated in from off screen | |
13 | menuElement: document.querySelector( '.meny' ), | |
14 | ||
15 | // The contents that gets pushed aside while Meny is active | |
16 | contentsElement: document.querySelector( '.contents' ), | |
17 | ||
18 | // [optional] The alignment of the menu (top/right/bottom/left) | |
19 | position: meny.Meny.getQuery().p || 'left', | |
20 | ||
21 | // [optional] The height of the menu (when using top/bottom position) | |
22 | height: 200, | |
23 | ||
24 | // [optional] The width of the menu (when using left/right position) | |
25 | width: 260, | |
26 | ||
27 | // [optional] Distance from mouse (in pixels) when menu should open | |
28 | threshold: 40, | |
29 | ||
30 | // [optional] Use mouse movement to automatically open/close | |
31 | mouse: true, | |
32 | ||
33 | // [optional] Use touch swipe events to open/close | |
34 | touch: true | |
35 | }); | |
36 | ||
37 | // API Methods: | |
38 | // meny.open(); | |
39 | // meny.close(); | |
40 | // meny.isOpen(); | |
41 | // meny.addEventListener( 'open', function(){ console.log( 'open' ); } ); | |
42 | // meny.addEventListener( 'close', function(){ console.log( 'close' ); } ); | |
43 | // Embed an iframe if a URL is passed in | |
44 | if( meny.Meny.getQuery().u && meny.Meny.getQuery().u.match( /^http/gi ) ) { | |
45 | var contents = document.querySelector( '.contents' ); | |
46 | contents.style.padding = '0px'; | |
47 | contents.innerHTML = '<div class="cover"></div><iframe src="'+ meny.Meny.getQuery().u +'" style="width: 100%; height: 100%; border: 0; position: absolute;"></iframe>'; | |
48 | } | |
49 | ||
50 | ||
51 | - | } |
51 | + | }.property('sidebar') |
52 | }); |