Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* global meny */
- import Ember from 'ember';
- export default Ember.View.extend({
- templatename: "sidebar",
- createMeny: function(){
- console.log("Hello");
- var menu = meny.Meny.create({
- // The element that will be animated in from off screen
- menuElement: document.querySelector( '.meny' ),
- // The contents that gets pushed aside while Meny is active
- contentsElement: document.querySelector( '.contents' ),
- // [optional] The alignment of the menu (top/right/bottom/left)
- position: meny.Meny.getQuery().p || 'left',
- // [optional] The height of the menu (when using top/bottom position)
- height: 200,
- // [optional] The width of the menu (when using left/right position)
- width: 260,
- // [optional] Distance from mouse (in pixels) when menu should open
- threshold: 40,
- // [optional] Use mouse movement to automatically open/close
- mouse: true,
- // [optional] Use touch swipe events to open/close
- touch: true
- });
- // API Methods:
- // meny.open();
- // meny.close();
- // meny.isOpen();
- // meny.addEventListener( 'open', function(){ console.log( 'open' ); } );
- // meny.addEventListener( 'close', function(){ console.log( 'close' ); } );
- // Embed an iframe if a URL is passed in
- if( meny.Meny.getQuery().u && meny.Meny.getQuery().u.match( /^http/gi ) ) {
- var contents = document.querySelector( '.contents' );
- contents.style.padding = '0px';
- contents.innerHTML = '<div class="cover"></div><iframe src="'+ meny.Meny.getQuery().u +'" style="width: 100%; height: 100%; border: 0; position: absolute;"></iframe>';
- }
- }.property('sidebar').on('init')
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement