Skip to content

Commit

Permalink
Merge pull request #273 from rijn/253
Browse files Browse the repository at this point in the history
IE<=11 do not support toString.
  • Loading branch information
icarusion authored Feb 15, 2017
2 parents 38646a1 + be0769d commit d8de604
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/carousel/carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
type: [String, Number],
default: 'auto',
validator (value) {
return value === 'auto' || toString.call(value) === '[object Number]';
return value === 'auto' || Object.prototype.toString.call(value) === '[object Number]';
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/notice/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function notice (type, options) {
key: noticeKey.toString(),
duration: duration,
style: {},
transitionName: 'move-right',
transitionName: 'move-notice',
content: content,
onClose: onClose,
closable: true
Expand Down
42 changes: 42 additions & 0 deletions src/styles/animation/move.less
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,45 @@
opacity: 0;
}
}

// specific transition for Notice

.move-motion(move-notice, ivuMoveNotice);
@import '../components/notice.less';

@keyframes ivuMoveNoticeIn {
0% {
opacity: 0;
transform-origin: 0 0;
transform: translateX(100%);
}
100% {
opacity: 1;
transform-origin: 0 0;
transform: translateX(0%);
}
}

@keyframes ivuMoveNoticeOut {
0% {
transform-origin: 0 0;
transform: translateX(0%);
opacity: 1;
}
70% {
transform-origin: 0 0;
transform: translateX(100%);
height: auto;
padding: @notice-padding;
margin-bottom: @notice-margin-bottom;
opacity: 0;
}
100% {
transform-origin: 0 0;
transform: translateX(100%);
height: 0;
padding: 0;
margin-bottom: 0;
opacity: 0;
}
}
1 change: 1 addition & 0 deletions test/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ li + li {
<li><a v-link="'/rate'">Rate</a></li>
<li><a v-link="'/upload'">Upload</a></li>
<li><a v-link="'/tree'">Tree</a></li>
<li><a v-link="'/notice'">Notice</a></li>
</ul>
</nav>
<router-view></router-view>
Expand Down
5 changes: 5 additions & 0 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ router.map({
require(['./routers/tree.vue'], resolve);
}
},
'/notice': {
component: function (resolve) {
require(['./routers/notice.vue'], resolve);
}
},
});

router.beforeEach(function () {
Expand Down
19 changes: 19 additions & 0 deletions test/routers/notice.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<i-button @click="pop">Pop</i-button>
</template>
<script>
export default {
methods: {
pop () {
for (let i = 0; i < 6; i++) {
setTimeout(() => {
this.$Notice.open({
title: 'test',
duration: 1.5 + i
});
}, i * 500);
}
}
}
}
</script>

0 comments on commit d8de604

Please sign in to comment.