fix some styles

pull/366/head
Leopoldthecoder 2016-10-12 21:12:54 +08:00 committed by cinwell.li
parent ba27ca55d4
commit 54ced05415
8 changed files with 19 additions and 12 deletions

View File

@ -11,6 +11,10 @@
margin: 5px 0;
min-width: 513px;
&.has-sidebar {
min-width: 620px;
}
@e body, body-wrapper {
&::after {
content: "";

View File

@ -275,7 +275,7 @@
disabledDate: '',
leftTimePickerVisible: false,
rightTimePickerVisible: false,
width: 0
width: ''
};
},

View File

@ -345,7 +345,7 @@
month: null,
week: null,
timePickerVisible: false,
width: 0
width: ''
};
},

View File

@ -93,7 +93,7 @@
minSeconds: minTime.getSeconds(),
format: 'HH:mm:ss',
visible: false,
width: 0
width: ''
};
},

View File

@ -93,7 +93,7 @@
value: '',
visible: false,
minTime: '',
width: 0
width: ''
};
},

View File

@ -83,7 +83,7 @@
selectableRange: [],
currentDate: this.$options.defaultValue || this.date,
currentVisible: this.visible,
width: 0
width: ''
};
},

View File

@ -51,8 +51,8 @@
mounted() {
this.referenceElm = this.$parent.$refs.reference.$el;
this.$parent.popperElm = this.popperElm = this.$el;
this.$on('updatePopper', _ => { this.showPopper = true; });
this.$on('destroyPopper', _ => { this.showPopper = false; });
this.$on('updatePopper', this.updatePopper);
this.$on('destroyPopper', this.destroyPopper);
}
};
</script>

View File

@ -83,7 +83,10 @@ export default {
options.placement = this.placement;
options.offset = this.offset;
this.popperJS = new PopperJS(reference, popper, options);
this.popperJS.onCreate(_ => this.$emit('created', this));
this.popperJS.onCreate(_ => {
this.$emit('created', this);
this.resetTransformOrigin();
});
this.popperJS._popper.style.zIndex = PopupManager.nextZIndex();
},
@ -99,15 +102,15 @@ export default {
destroyPopper() {
if (this.popperJS) {
this.resetTransformOrigin(this.popperJS);
this.resetTransformOrigin();
}
},
resetTransformOrigin(popper) {
resetTransformOrigin() {
let placementMap = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };
let placement = popper._popper.getAttribute('x-placement').split('-')[0];
let placement = this.popperJS._popper.getAttribute('x-placement').split('-')[0];
let origin = placementMap[placement];
popper._popper.style.transformOrigin = ['top', 'bottom'].indexOf(placement) > -1 ? `center ${ origin }` : `${ origin } center`;
this.popperJS._popper.style.transformOrigin = ['top', 'bottom'].indexOf(placement) > -1 ? `center ${ origin }` : `${ origin } center`;
},
appendArrow(element) {