Skip to content

Instantly share code, notes, and snippets.

@kumkanillam
Created June 6, 2017 07:07
Show Gist options
  • Save kumkanillam/da0c4709f2fdb02a72005eb0430d2d2f to your computer and use it in GitHub Desktop.
Save kumkanillam/da0c4709f2fdb02a72005eb0430d2d2f to your computer and use it in GitHub Desktop.
EPS test
import Ember from 'ember';
const countries = [
{ name: 'United States', flagUrl: '/flags/us.svg', population: 321853000 },
{ name: 'Spain', flagUrl: '/flags/es.svg', population: 46439864 },
{ name: 'Portugal', flagUrl: '/flags/pt.svg', population: 10374822 },
{ name: 'Russia', flagUrl: '/flags/ru.svg', population: 146588880 },
{ name: 'Latvia', flagUrl: '/flags/lv.svg', population: 1978300 },
{ name: 'Brazil', flagUrl: '/flags/br.svg', population: 204921000 },
{ name: 'United Kingdom', flagUrl: '/flags/gb.svg', population: 64596752 },
];
export default Ember.Controller.extend({
countries: countries,
destination: countries[2]
});
@import 'general.css'
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.myheight {
height: 500px;
background-color: green;
}
.myeps .ember-power-select-option[role="listbox"] {
background-color: red;
}
<div id="ember-basic-dropdown-wormhole"> </div>
<div class="myeps">
<div class="ember-power-select-option" role="listbox">
My EPS
</div>
</div>
<div style="width: 300px;">
{{#power-select
options=countries
selected=country
selectedItemComponent="selected-item-country"
searchField="name"
onchange=(action (mut country))
triggerClass="myeps"
dropdownClass="myeps"
as |country|
}}
<div class="country-detailed-info">
<img src="{{country.flagUrl}}" class="country-flag">
<div class="country-data-text">
<strong>{{country.name}}</strong>
<br>
<small>Population in 2014: <i>{{country.population}}</i></small>
</div>
</div>
{{/power-select}}
</div>
{{outlet}}
{
"version": "0.12.1",
"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.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1",
"ember-power-select" : "1.8.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment