Skip to content

Commit

Permalink
delegates submit button visibility to stylesheet
Browse files Browse the repository at this point in the history
Instead of deciding in the template to only show the submit button for
the text input action on mobile, we make that determination in the base
stylesheet. This allows greater flexibility in where and how this submit
button can be displayed.
  • Loading branch information
allanlasser committed Jul 17, 2017
1 parent 1ae01d9 commit 9630ee8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/botui.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<input type="text" ref="input" :type="action.text.sub_type"
v-model="action.text.value" class="botui-actions-text-input" :placeholder="action.text.placeholder"
:size="action.text.size" :value="action.text.value" :class="action.text.cssClass" required v-focus/>
<button v-if="isMobile" class="botui-actions-text-submit">Go</button>
<button type="submit" class="botui-actions-text-submit">Go</button>
</form>
<div v-if="action.type == 'button'" class="botui-actions-buttons" :class="action.cssClass">
<button type="button" :class="button.cssClass"
Expand Down
8 changes: 7 additions & 1 deletion src/styles/botui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
&.human {
float: right;
}

iframe {
width: 100%;
}
Expand All @@ -57,3 +57,9 @@
margin-left: 10px;
}
}

.botui-actions-text-submit {
@media (min-width: 400px) {
display: none;
}
}

0 comments on commit 9630ee8

Please sign in to comment.