Skip to content

Instantly share code, notes, and snippets.

@jacobq
Forked from Gaurav0/controllers.application.js
Last active December 15, 2020 01:58
Show Gist options
  • Save jacobq/ff9ff22445f6215d4f238f6c35e2d4bc to your computer and use it in GitHub Desktop.
Save jacobq/ff9ff22445f6215d4f238f6c35e2d4bc to your computer and use it in GitHub Desktop.
Modal Dialog Test
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'ember-modal-dialog test',
show: false,
actions: {
toggle() {
this.toggleProperty('show');
}
}
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
// Have to copy this from addon due to no support for scss
.ember-modal-overlay {
height: 100%;
left: 0;
position: fixed;
right: 0;
top: 0;
z-index: 50;
}
.ember-modal-dialog {
z-index: 50;
position: fixed;
&.ember-modal-dialog-in-place {
position: relative;
}
}
.ember-modal-dialog {
border-radius: 8px;
background-color: #fff;
box-shadow: 0 0 10px #222;
padding: 10px;
}
.ember-modal-overlay.translucent {
background-color: rgba(#808080, .77);
}
<h1>Welcome to {{appName}}</h1>
show: {{show}}<br>
<a href='' {{action 'toggle'}}>Toggle</a>
{{#liquid-if show}}
{{#modal-dialog onClose='toggle'}}Oh hai there!{{/modal-dialog}}
{{/liquid-if}}
{
"version": "0.9.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.9.0",
"ember-data": "2.8.0",
"ember-template-compiler": "2.9.0",
"liquid-fire": "0.27.3",
"liquid-wormhole": "2.0.5"
},
"addons": {
"ember-modal-dialog": "2.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment