Last active
May 4, 2016 11:05
-
-
Save ykaragol/c8348df180c6227d3bd720d5d5aaecfb to your computer and use it in GitHub Desktop.
modal-test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
modalService : Ember.inject.service(), | |
inModal:Ember.computed.alias('modalService.inModal') | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none' | |
}); | |
Router.map(function() { | |
this.route('first-route', function () { | |
this.route('child-route'); | |
}); | |
this.route('second-route'); | |
}); | |
export default Router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
modalService : Ember.inject.service(), | |
beforeModel(transition){ | |
console.log('....'); | |
this._super(...arguments); | |
this.set('params', transition.queryParams); | |
}, | |
renderTemplate(){ | |
let params= this.get('params'); | |
if(params.inmodal){ | |
console.log(this.get('routeName')); | |
this.set('modalService.inModal', true); | |
let path = this.get('routeName').replace('.', '/'); | |
this.render(path,{ outlet: 'appmodal' }); | |
}else{ | |
this.render(); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
modalService : Ember.inject.service(), | |
actions:{ | |
close(){ | |
this.set('modalService.inModal', false); | |
this.transitionTo('index'); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import AbstractRoute from '../abstract-route' | |
export default AbstractRoute.extend({ | |
model(){ | |
console.log('here im haha'); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import AbstractRoute from './abstract-route' | |
export default AbstractRoute.extend({ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import AbstractRoute from './abstract-route' | |
export default AbstractRoute.extend({ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Service.extend({ | |
inModal: false | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.notOpen { | |
display: none; | |
} | |
.modalDialog { | |
display: block; | |
position: fixed; | |
z-index: 1; | |
left: 0; | |
top: 0; | |
width: 100%; | |
height: 100%; | |
overflow: auto; | |
background-color: rgb(0,0,0); | |
background-color: rgba(0,0,0,0.4); | |
} | |
.modalDialog > div { | |
width: 300px; | |
position: relative; | |
margin: 10% auto; | |
padding: 5px 20px 13px 20px; | |
background: #fff; | |
} | |
.close:hover { | |
background: #00d9ff; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.8.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.5.1", | |
"ember-data": "2.5.2", | |
"ember-template-compiler": "2.5.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment