mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Remove button styles on polls.
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
import { iconHTML } from 'discourse/helpers/fa-icon';
|
||||
|
||||
export default Em.Component.extend({
|
||||
tagName: "li",
|
||||
attributeBindings: ["data-poll-option-id", "data-poll-selected"],
|
||||
attributeBindings: ["data-poll-option-id"],
|
||||
|
||||
"data-poll-option-id": Em.computed.alias("option.id"),
|
||||
|
||||
"data-poll-selected": function() {
|
||||
return this.get("option.selected") ? "selected" : false;
|
||||
}.property("option.selected"),
|
||||
|
||||
render(buffer) {
|
||||
buffer.push(this.get("option.html"));
|
||||
@computed("option.selected", "isMultiple")
|
||||
optionIcon(selected, isMultiple) {
|
||||
if (isMultiple) {
|
||||
return iconHTML(selected ? 'check-square-o' : 'square-o');
|
||||
} else {
|
||||
return iconHTML(selected ? 'dot-circle-o' : 'circle-o');
|
||||
}
|
||||
},
|
||||
|
||||
click(e) {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
{{{optionIcon}}}
|
||||
{{option.html}}
|
||||
@@ -9,7 +9,7 @@
|
||||
{{else}}
|
||||
<ul>
|
||||
{{#each poll.options as |option|}}
|
||||
{{poll-option option=option toggle="toggleOption"}}
|
||||
{{poll-option option=option toggle="toggleOption" isMultiple=isMultiple}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user