Skip to content

Commit

Permalink
Close simonv3#49. Other text can be set to something else
Browse files Browse the repository at this point in the history
  • Loading branch information
simonv3 committed Nov 23, 2016
1 parent 0da622b commit abbea1d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@
</a>
</div>
<div class="form-align-group" ng-if="option.type === 'other'">
<label for="{{ }}-other">Other: </label>
<label class="other-option-label" for="{{ }}-other"
ng-class="{active: active}">
<span class="other-label"
ng-click="active = true">{{ option.otherLabel || 'Other' }}:</span>
<input ng-model="option.otherLabel"
type="text"
ng-blur="active = false"></input>
</label>
<input id="{{ }}-other" type="text" disabled/>
<a ng-click="removeOther()">
<i class="icon-cross"></i>
Expand Down
2 changes: 1 addition & 1 deletion client/js/surveys/directives/survey-question-radio.ng.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name="{{ question.question }}"
type="{{ question.type }}"
ng-change="optionChanged(option)"
/> Other
/> {{ option.otherLabel || 'Other' }}
</span>

<input ng-if="option.type === 'other' && choosingOther"
Expand Down
22 changes: 22 additions & 0 deletions client/styles/manage.less
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,25 @@
margin-left: 2rem;
}
}

.other-option-label {

input {
display: none;

float: right;
text-align: right;
}

&.active {
span {
display: none;
}

input {
display: block;
}
}
}


0 comments on commit abbea1d

Please sign in to comment.