Skip to content

Commit

Permalink
feat: #224 Dialog - styling buttons
Browse files Browse the repository at this point in the history
When defining buttons you can use "classes" and "style" props
  • Loading branch information
rstoenescu committed Dec 18, 2016
1 parent b98fb7d commit ed21775
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
21 changes: 21 additions & 0 deletions dev/components/global/dialog.vue
Expand Up @@ -80,6 +80,27 @@ export default {
})
}
},
{
label: 'Custom CSS classes & style to buttons',
icon: 'format_color_fill',
handler () {
Dialog.create({
title: 'Confirm',
message: 'Custom button classes.',
buttons: [
{
label: 'Disagree',
classes: 'negative clear',
style: 'text-decoration: underline'
},
{
label: 'Agree',
classes: 'positive'
}
]
})
}
},
{
label: 'Stacked Buttons Example',
icon: 'reorder',
Expand Down
5 changes: 3 additions & 2 deletions src/components/dialog/Dialog.vue
Expand Up @@ -17,7 +17,7 @@
<input type="text" class="full-width" v-model="el.model" :placeholder="el.placeholder" required>
<label v-html="el.label"></label>
</div>

<div v-if="el.type === 'password'" class="floating-label" style="margin-bottom: 10px">
<input type="password" class="full-width" v-model="el.model" :placeholder="el.placeholder" required>
<label v-html="el.label"></label>
Expand Down Expand Up @@ -99,8 +99,9 @@
>
<button
v-for="button in buttons"
class="primary clear"
@click="trigger(button.handler)"
:class="button.classes || 'primary clear'"
:style="button.style"
v-html="typeof button === 'string' ? button : button.label"
></button>
</div>
Expand Down
3 changes: 0 additions & 3 deletions src/vue-components/modal/modal.ios.styl
Expand Up @@ -120,9 +120,6 @@ maximized-modal()
border-radius 0
&:last-child
font-weight bold
&:hover, &:active
color white !important
background rgba(0, 0, 0, .3) !important
&.row
button + button
border-left 1px solid $form-darker-color
Expand Down

0 comments on commit ed21775

Please sign in to comment.