Skip to content

Commit

Permalink
Fix display of correct button for image upload
Browse files Browse the repository at this point in the history
Implement logic to show either the "Add Image to Question" or
"Remove Image" button in Studio view.
  • Loading branch information
jleong-openedx committed Jul 24, 2017
1 parent db0cebf commit 19ea3fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ubcpi/static/html/ubcpi_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@
<div class="pi-label-and-hint">
<label class="label setting-label pi-setting-label" for="pi-question-text" aria-describedby="pi-question-text-tip" translate>Question Text <font color="red">*</font></label>
<span class="tip setting-help" id="pi-question-text-tip" translate>The question appears above the possible answers that you set below. You can use text, an image, or a combination of both. If you wish to add an image to your question, press the "Add Image To Question" button.</span>
<!--<button id="add-image-question-button" type="button" class="button action-primary add-image-button" ng-click="esc.image_show_fields(false)" onclick="this.style.display='block';this.style.display='none'; document.getElementById('remove-image-question-button').style.display='block'" name="add-image-button">{{'Add Image To Question' | translate}}</button>-->
<div ng-if="!esc.data.question_text.image_show_fields">
<button id="remove-image-question-button" type="button" type="button" class="button action-primary add-image-button" ng-click="esc.image_show_fields(false)" onclick="this.style.display='block';document.getElementById('add-image-question-button').style.display='block'" name="add-image-button">{{'Remove Image' | translate}}</button></div>
<button id="add-image-question-button" type="button" class="button action-primary add-image-button" ng-click="esc.image_show_fields(false)" onclick="this.style.display='block';this.style.display='none'; document.getElementById('remove-image-question-button').style.display='block'" name="add-image-button">{{'Add Image To Question' | translate}}</button>
</div>
<div ng-if="esc.data.question_text.image_show_fields">
<button id="remove-image-question-button" type="button" type="button" class="button action-primary add-image-button" ng-click="esc.image_show_fields(false)" onclick="this.style.display='block';document.getElementById('add-image-question-button').style.display='block'" name="add-image-button">{{'Remove Image' | translate}}</button>
</div>
</div>
<textarea class="input setting-input" name="question_text" id="pi-question-text" ng-model="esc.data.question_text.text" ng-model-options="{ debounce: 500 }"></textarea>

Expand Down

0 comments on commit 19ea3fb

Please sign in to comment.