Skip to content

Commit

Permalink
fixed multi popup
Browse files Browse the repository at this point in the history
  • Loading branch information
unclay committed May 31, 2016
1 parent 7016972 commit a858df4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,18 @@ PickerDialog.prototype._bindEvents = function () {
PickerDialog.prototype.show = function () {
var _this = this
_this.mask.classList.add('show')
_this.container.classList.add('show')
_this.params._open && _this.params._open(this)
_this.params.onOpen && _this.params.onOpen(this)
return this
}

PickerDialog.prototype.hide = function () {
var _this = this
_this.mask.classList.remove('show')
_this.container.classList.remove('show')
if (!document.querySelector('.picker-dialog.show')) {
_this.mask.classList.remove('show')
}
_this.params._close && _this.params._close(this)
_this.params.onClose && _this.params.onClose(this)
return this
Expand Down
26 changes: 26 additions & 0 deletions src/demos/Popup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<switch title="Default popup" :value.sync="show"></switch>
<switch title="Full popup" :value.sync="show1"></switch>
<switch title="with a Scroller" :value.sync="show2"></switch>
<switch title="Multi popup (first)" :value.sync="show3"></switch>
</group>
<popup :show.sync="show">
<div class="popup0">
Expand Down Expand Up @@ -32,6 +33,25 @@
</scroller>
</popup>

<popup :show.sync="show3">
<div class="popup2">
<group>
<switch title="Multi Popup (first)" :value.sync="show3"></switch>
<switch title="Multi Popup (second)" :value.sync="show4"></switch>
</group>
this is the first popup
</div>
</popup>

<popup :show.sync="show4">
<div class="popup2">
<group>
<switch title="Multi Popup (second)" :value.sync="show4"></switch>
</group>
this is the second popup
</div>
</popup>

</div>
</template>

Expand All @@ -51,6 +71,8 @@ export default {
show: false,
show1: false,
show2: false,
show3: false,
show4: false,
showToast: false
}
},
Expand All @@ -71,4 +93,8 @@ export default {
width:100%;
height:100%;
}
.popup2 {
padding-bottom:15px;
height:400px;
}
</style>

0 comments on commit a858df4

Please sign in to comment.