Skip to content

Instantly share code, notes, and snippets.

@knownasilya
Created June 10, 2013 15:29
Show Gist options
  • Save knownasilya/5749678 to your computer and use it in GitHub Desktop.
Save knownasilya/5749678 to your computer and use it in GitHub Desktop.
Custom Select
{{view App.CustomSelectView
optionsBinding="content"
selectedBinding="selected"
title="Broadband Maps"
}}
App.CustomSelectView = Ember.View.extend({
templateName: "customSelect",
tagName: "ul",
classNames: ["custom-select"],
title: "Custom Select",
selected: null,
options: null,
click: function (event) {
console.dir(event.target);
},
didInsertElement: function () {
this._super();
L.DomEvent.disableClickPropagation(document.getElementById(this.get("elementId")));
}
});
<li class="title">
{{view.title}}
<small class="pull-right">(Select One)</small>
</li>
{{#each option in view.options}}
<li class="option{{#selected}} selected{{/selected}}" data-value="{{value}}">
{{option}}
<a class="settings pull-right">
<i class="icon-cog icon-white"></i>
</a>
</li>
{{/each}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment