| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  | <template> | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |   <div class="md-landscape" :class="{'is-full': fullScreen}"> | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  | 		<md-popup | 
					
						
							|  |  |  |       v-model="isLandscapeShow" | 
					
						
							| 
									
										
										
										
											2018-04-24 11:35:02 +08:00
										 |  |  |       :mask-closable="maskClosable" | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |       prevent-scroll | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |       :prevent-scroll-exclude="scroll ? '.landscape-content' : null" | 
					
						
							|  |  |  |       :has-mask="!fullScreen && hasMask" | 
					
						
							| 
									
										
										
										
											2018-09-15 20:52:20 +08:00
										 |  |  |       :transition="fullScreen ? 'md-zoom' : 'md-punch'" | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |       @input="$emit('input', false)" | 
					
						
							|  |  |  |       @show="$emit('show')" | 
					
						
							|  |  |  |       @hide="$emit('hide')"> | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |       <div class="landscape-content" :class="{scroll}"> | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |         <slot></slot> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |     </md-popup> | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |     <div class="landscape-close" | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |       @click="$_close" | 
					
						
							|  |  |  |       v-show="isLandscapeShow" | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |       :class="{dark: !hasMask || fullScreen}"> | 
					
						
							|  |  |  |       <md-icon name="cross"></md-icon> | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |     </div> | 
					
						
							|  |  |  |   </div> | 
					
						
							|  |  |  | </template> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script>
import Popup from '../popup' | 
					
						
							|  |  |  | import Icon from '../icon' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default { | 
					
						
							|  |  |  |   name: 'md-landscape', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   components: { | 
					
						
							|  |  |  |     [Popup.name]: Popup, | 
					
						
							|  |  |  |     [Icon.name]: Icon, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   props: { | 
					
						
							|  |  |  |     value: { | 
					
						
							|  |  |  |       type: Boolean, | 
					
						
							|  |  |  |       default: false, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     scroll: { | 
					
						
							|  |  |  |       type: Boolean, | 
					
						
							|  |  |  |       default: false, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |     fullScreen: { | 
					
						
							|  |  |  |       type: Boolean, | 
					
						
							|  |  |  |       default: false, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |     hasMask: { | 
					
						
							|  |  |  |       type: Boolean, | 
					
						
							|  |  |  |       default: true, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2018-04-24 11:35:02 +08:00
										 |  |  |     maskClosable: { | 
					
						
							|  |  |  |       type: Boolean, | 
					
						
							|  |  |  |       default: false, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |   }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   data() { | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |       isLandscapeShow: this.value, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   watch: { | 
					
						
							|  |  |  |     value(val) { | 
					
						
							|  |  |  |       this.isLandscapeShow = val | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   methods: { | 
					
						
							|  |  |  |     // MARK: private methods
 | 
					
						
							|  |  |  |     $_close() { | 
					
						
							|  |  |  |       this.isLandscapeShow = false | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
</script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <style lang="stylus"> | 
					
						
							|  |  |  | .md-landscape | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |   &.is-full | 
					
						
							|  |  |  |     .md-popup.center .md-popup-box | 
					
						
							|  |  |  |       absolute-pos() | 
					
						
							|  |  |  |       transform none | 
					
						
							|  |  |  |       background landscape-fullscreen-bg | 
					
						
							|  |  |  |     .landscape-content | 
					
						
							|  |  |  |       width 100% | 
					
						
							|  |  |  |       height 100% | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   .md-popup.with-mask, .md-popup .md-popup-box | 
					
						
							|  |  |  |     z-index landscape-zindex | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   .landscape-content | 
					
						
							|  |  |  |     display flex | 
					
						
							|  |  |  |     justify-content center | 
					
						
							|  |  |  |     align-items center | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |     position relative | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |     width landscape-width | 
					
						
							|  |  |  |     font-size font-body-large | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |     text-align center | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |     border-radius landscape-radius | 
					
						
							|  |  |  |     overflow hidden | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |     >img | 
					
						
							|  |  |  |       width 100% | 
					
						
							|  |  |  |       height 100% | 
					
						
							|  |  |  |       display block | 
					
						
							|  |  |  |     &.scroll | 
					
						
							|  |  |  |       max-height 700px | 
					
						
							|  |  |  |       overflow-y scroll | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |   .landscape-close | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |     position fixed | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |     z-index landscape-zindex | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |     left 0 | 
					
						
							|  |  |  |     right 0 | 
					
						
							|  |  |  |     bottom 10% | 
					
						
							|  |  |  |     color color-text-base-inverse | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |     text-align center | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |     &.dark | 
					
						
							|  |  |  |       color color-text-base | 
					
						
							| 
									
										
										
										
											2018-08-30 16:47:41 +08:00
										 |  |  |     .md-icon | 
					
						
							|  |  |  |       width 50px | 
					
						
							|  |  |  |       height 50px | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  | </style> |