Skip to content

Commit

Permalink
fix: interactive classname
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode authored and luckyadam committed Aug 9, 2020
1 parent a866412 commit e4d5b9c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/taro-h5/src/api/interactive/actionSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ export default class ActionSheet {

// mask
const mask = document.createElement('div')
mask.className = 'taro-actionsheet__mask'
mask.setAttribute('style', inlineStyle(maskStyle))

// actionSheet
this.actionSheet = document.createElement('div')
this.actionSheet.className = 'taro-actionsheet__content'
this.actionSheet.setAttribute('style', inlineStyle(actionSheetStyle))

// menu
this.menu = document.createElement('div')
this.menu.className = 'taro-actionsheet__menu'
this.menu.setAttribute('style', inlineStyle({
...menuStyle,
color: config.itemColor
Expand All @@ -100,6 +103,7 @@ export default class ActionSheet {

// cancel
this.cancel = document.createElement('div')
this.cancel.className = 'taro-actionsheet__btn taro-actionsheet__cancel'
this.cancel.setAttribute('style', inlineStyle(cancelStyle))
this.cancel.textContent = '取消'

Expand Down
2 changes: 1 addition & 1 deletion packages/taro-h5/src/api/interactive/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function init (doc) {
if (status === 'ready') return

const taroStyle = doc.createElement('style')
taroStyle.textContent = '@font-face{font-weight:normal;font-style:normal;font-family:"taro";src:url("data:application/x-font-ttf;charset=utf-8;base64, AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzJWs0t/AAABfAAAAFZjbWFwqVgGvgAAAeAAAAGGZ2x5Zph7qG0AAANwAAAAdGhlYWQRFoGhAAAA4AAAADZoaGVhCCsD7AAAALwAAAAkaG10eAg0AAAAAAHUAAAADGxvY2EADAA6AAADaAAAAAhtYXhwAQ4AJAAAARgAAAAgbmFtZYrphEEAAAPkAAACVXBvc3S3shtSAAAGPAAAADUAAQAAA+gAAABaA+gAAAAAA+gAAQAAA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AAAHQAAAAEAAAAAAAEABAAdAAEAAAAAAAIABwAhAAEAAAAAAAMABAAoAAEAAAAAAAQABAAsAAEAAAAAAAUACwAwAAEAAAAAAAYABAA7AAEAAAAAAAoAKwA/AAEAAAAAAAsAEwBqAAMAAQQJAAAAOgB9AAMAAQQJAAEACAC3AAMAAQQJAAIADgC/AAMAAQQJAAMACADNAAMAAQQJAAQACADVAAMAAQQJAAUAFgDdAAMAAQQJAAYACADzAAMAAQQJAAoAVgD7AAMAAQQJAAsAJgFRCiAgQ3JlYXRlZCBieSBmb250LWNhcnJpZXIKICB3ZXVpUmVndWxhcndldWl3ZXVpVmVyc2lvbiAxLjB3ZXVpR2VuZXJhdGVkIGJ5IHN2ZzJ0dGYgZnJvbSBGb250ZWxsbyBwcm9qZWN0Lmh0dHA6Ly9mb250ZWxsby5jb20ACgAgACAAQwByAGUAYQB0AGUAZAAgAGIAeQAgAGYAbwBuAHQALQBjAGEAcgByAGkAZQByAAoAIAAgAHcAZQB1AGkAUgBlAGcAdQBsAGEAcgB3AGUAdQBpAHcAZQB1AGkAVgBlAHIAcwBpAG8AbgAgADEALgAwAHcAZQB1AGkARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwECAQMBBAABeAd1bmlFQTA4AAAAAAA=") format("truetype");}@-webkit-keyframes taroLoading{0%{-webkit-transform:rotate3d(0, 0, 1, 0deg);}100%{-webkit-transform:rotate3d(0, 0, 1, 360deg);transform:rotate3d(0, 0, 1, 360deg);}}@keyframes taroLoading{0%{-webkit-transform:rotate3d(0, 0, 1, 0deg);}100%{-webkit-transform:rotate3d(0, 0, 1, 360deg);transform:rotate3d(0, 0, 1, 360deg);}}.taro-modal__foot:after {content: "";position: absolute;left: 0;top: 0;right: 0;height: 1px;border-top: 1px solid #D5D5D6;color: #D5D5D6;-webkit-transform-origin: 0 0;transform-origin: 0 0;-webkit-transform: scaleY(0.5);transform: scaleY(0.5);} .taro-model__btn:active {background-color: #EEEEEE}.taro-model__btn:not(:first-child):after {content: "";position: absolute;left: 0;top: 0;width: 1px;bottom: 0;border-left: 1px solid #D5D5D6;color: #D5D5D6;-webkit-transform-origin: 0 0;transform-origin: 0 0;-webkit-transform: scaleX(0.5);transform: scaleX(0.5);}.taro-actionsheet__cell:not(:first-child):after {content: "";position: absolute;left: 0;top: 0;right: 0;height: 1px;border-top: 1px solid #e5e5e5;color: #e5e5e5;-webkit-transform-origin: 0 0;transform-origin: 0 0;-webkit-transform: scaleY(0.5);transform: scaleY(0.5);}'
taroStyle.textContent = '@font-face{font-weight:normal;font-style:normal;font-family:"taro";src:url("data:application/x-font-ttf;charset=utf-8;base64, AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzJWs0t/AAABfAAAAFZjbWFwqVgGvgAAAeAAAAGGZ2x5Zph7qG0AAANwAAAAdGhlYWQRFoGhAAAA4AAAADZoaGVhCCsD7AAAALwAAAAkaG10eAg0AAAAAAHUAAAADGxvY2EADAA6AAADaAAAAAhtYXhwAQ4AJAAAARgAAAAgbmFtZYrphEEAAAPkAAACVXBvc3S3shtSAAAGPAAAADUAAQAAA+gAAABaA+gAAAAAA+gAAQAAAAAAAAAAAAAAAAAAAAMAAQAAAAEAAADih+FfDzz1AAsD6AAAAADXB57LAAAAANcHnssAAP/sA+gDOgAAAAgAAgAAAAAAAAABAAAAAwAYAAEAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKAB4ALAABREZMVAAIAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAAAAQK8AZAABQAIAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAA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RCiAgQ3JlYXRlZCBieSBmb250LWNhcnJpZXIKICB3ZXVpUmVndWxhcndldWl3ZXVpVmVyc2lvbiAxLjB3ZXVpR2VuZXJhdGVkIGJ5IHN2ZzJ0dGYgZnJvbSBGb250ZWxsbyBwcm9qZWN0Lmh0dHA6Ly9mb250ZWxsby5jb20ACgAgACAAQwByAGUAYQB0AGUAZAAgAGIAeQAgAGYAbwBuAHQALQBjAGEAcgByAGkAZQByAAoAIAAgAHcAZQB1AGkAUgBlAGcAdQBsAGEAcgB3AGUAdQBpAHcAZQB1AGkAVgBlAHIAcwBpAG8AbgAgADEALgAwAHcAZQB1AGkARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwECAQMBBAABeAd1bmlFQTA4AAAAAAA=") format("truetype")}@-webkit-keyframes taroLoading{0%{-webkit-transform:rotate3d(0,0,1,0deg)}100%{-webkit-transform:rotate3d(0,0,1,360deg);transform:rotate3d(0,0,1,360deg)}}@keyframes taroLoading{0%{-webkit-transform:rotate3d(0,0,1,0deg)}100%{-webkit-transform:rotate3d(0,0,1,360deg);transform:rotate3d(0,0,1,360deg)}}.taro-modal__content{word-wrap:break-word;word-break:break-all}.taro-modal__foot:after{content:"";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #d5d5d6;color:#d5d5d6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.taro-model__btn:active{background-color:#eee}.taro-model__btn:active{background-color:#eee}.taro-model__btn:not(:first-child):after{content:"";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #d5d5d6;color:#d5d5d6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.taro-actionsheet__cell:not(:first-child):after{content:"";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #e5e5e5;color:#e5e5e5;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}'
doc.querySelector('head').appendChild(taroStyle)

status = 'ready'
Expand Down
8 changes: 6 additions & 2 deletions packages/taro-h5/src/api/interactive/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ export default class Modal {

// mask
const mask = document.createElement('div')
mask.className = 'taro-modal__mask'
mask.setAttribute('style', inlineStyle(maskStyle))

// modal
const modal = document.createElement('div')
modal.className = 'taro-modal__content'
modal.setAttribute('style', inlineStyle(modalStyle))

// title
Expand All @@ -98,6 +100,7 @@ export default class Modal {
display: 'none'
}
this.title = document.createElement('div')
this.title.className = 'taro-modal__title'
this.title.setAttribute('style', inlineStyle(titleCSS))
this.title.textContent = config.title

Expand All @@ -108,6 +111,7 @@ export default class Modal {
color: '#353535'
}
this.text = document.createElement('div')
this.text.className = 'taro-modal__text'
this.text.setAttribute('style', inlineStyle(textCSS))
this.text.textContent = config.content

Expand All @@ -123,7 +127,7 @@ export default class Modal {
display: config.showCancel ? 'block' : 'none'
}
this.cancel = document.createElement('div')
this.cancel.className = 'taro-model__btn'
this.cancel.className = 'taro-model__btn taro-model__cancel'
this.cancel.setAttribute('style', inlineStyle(cancelCSS))
this.cancel.textContent = config.cancelText
this.cancel.onclick = () => {
Expand All @@ -136,7 +140,7 @@ export default class Modal {

// confirm button
this.confirm = document.createElement('div')
this.confirm.className = 'taro-model__btn'
this.confirm.className = 'taro-model__btn taro-model__confirm'
this.confirm.setAttribute('style', inlineStyle(btnStyle))
this.confirm.style.color = config.confirmColor
this.confirm.textContent = config.confirmText
Expand Down
4 changes: 4 additions & 0 deletions packages/taro-h5/src/api/interactive/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ export default class Toast {

// mask
this.mask = document.createElement('div')
this.mask.className = 'taro-toast__mask'
this.mask.setAttribute('style', inlineStyle(maskStyle))
this.mask.style.display = config.mask ? 'block' : 'none'

// icon
this.icon = document.createElement('p')
this.icon.className = 'taro-toast__icon'
if (config.image) {
this.icon.setAttribute('style', inlineStyle({
...imageStyle,
Expand All @@ -114,6 +116,7 @@ export default class Toast {

// toast
this.toast = document.createElement('div')
this.toast.className = 'taro-toast__content'
this.toast.setAttribute('style', inlineStyle({
...toastStyle,
...(config.icon === 'none' ? {
Expand All @@ -124,6 +127,7 @@ export default class Toast {

// title
this.title = document.createElement('p')
this.title.className = 'taro-toast__title'
this.title.setAttribute('style', inlineStyle(textStyle))
this.title.textContent = config.title

Expand Down

0 comments on commit e4d5b9c

Please sign in to comment.