Remove iCheck
This commit is contained in:
parent
3622ed7548
commit
164195e0dc
@ -24,7 +24,6 @@
|
||||
"echarts": "^4.1.0",
|
||||
"element-theme-chalk": "^2.6.3",
|
||||
"element-ui": "^2.6.3",
|
||||
"icheck": "^1.0.2",
|
||||
"jquery": "^3.3.1",
|
||||
"skinview3d": "^1.1.0",
|
||||
"vue": "^2.6.9",
|
||||
|
@ -281,16 +281,6 @@ export default {
|
||||
},
|
||||
async applyTexture() {
|
||||
this.players = await this.$http.get('/user/player/list')
|
||||
setTimeout(() => {
|
||||
$(this.$el).iCheck({
|
||||
radioClass: 'iradio_square-blue',
|
||||
checkboxClass: 'icheckbox_square-blue',
|
||||
})
|
||||
.on('ifChanged', function onChanged() {
|
||||
// eslint-disable-next-line no-invalid-this
|
||||
$(this)[0].dispatchEvent(new Event('change'))
|
||||
})
|
||||
}, 0)
|
||||
},
|
||||
async submitApplyTexture() {
|
||||
if (!this.selectedPlayer) {
|
||||
|
@ -34,7 +34,6 @@
|
||||
class="btn btn-warning btn-sm"
|
||||
data-toggle="modal"
|
||||
data-target="#modal-clear-texture"
|
||||
@click="loadICheck"
|
||||
/>
|
||||
<a
|
||||
v-t="'user.player.delete-player'"
|
||||
@ -301,16 +300,6 @@ export default {
|
||||
this.$message.warning(msg)
|
||||
}
|
||||
},
|
||||
loadICheck() {
|
||||
$('input').iCheck({
|
||||
radioClass: 'iradio_square-blue',
|
||||
checkboxClass: 'icheckbox_square-blue',
|
||||
})
|
||||
.on('ifChecked ifUnchecked', function onChange() {
|
||||
// eslint-disable-next-line no-invalid-this
|
||||
$(this)[0].dispatchEvent(new Event('change'))
|
||||
})
|
||||
},
|
||||
async clearTexture() {
|
||||
if (Object.values(this.clear).every(value => !value)) {
|
||||
return this.$message.warning(this.$t('user.noClearChoice'))
|
||||
|
@ -176,16 +176,6 @@ test('select texture', async () => {
|
||||
})
|
||||
|
||||
test('apply texture', async () => {
|
||||
window.$ = jest.fn(() => ({
|
||||
iCheck: () => ({
|
||||
on(_: Event, cb: CallableFunction) {
|
||||
cb()
|
||||
},
|
||||
}),
|
||||
0: {
|
||||
dispatchEvent: () => {},
|
||||
},
|
||||
}))
|
||||
Vue.prototype.$http.get
|
||||
.mockResolvedValueOnce({})
|
||||
.mockResolvedValueOnce([])
|
||||
@ -277,14 +267,6 @@ test('select specified texture initially', async () => {
|
||||
window.history.pushState({}, 'title', `${location.href}?tid=1`)
|
||||
window.$ = jest.fn(() => ({
|
||||
modal() {},
|
||||
iCheck: () => ({
|
||||
on(_: Event, cb: CallableFunction) {
|
||||
cb()
|
||||
},
|
||||
}),
|
||||
0: {
|
||||
dispatchEvent: () => {},
|
||||
},
|
||||
}))
|
||||
Vue.prototype.$http.get
|
||||
.mockResolvedValueOnce({
|
||||
|
@ -90,27 +90,6 @@ test('change player name', async () => {
|
||||
expect(wrapper.text()).toContain('new-name')
|
||||
})
|
||||
|
||||
test('load iCheck', async () => {
|
||||
Vue.prototype.$http.get
|
||||
.mockResolvedValueOnce([
|
||||
{ pid: 1 },
|
||||
])
|
||||
window.$ = jest.fn(() => ({
|
||||
iCheck: () => ({
|
||||
on(_: Event, cb: CallableFunction) {
|
||||
cb()
|
||||
},
|
||||
}),
|
||||
0: {
|
||||
dispatchEvent: () => {},
|
||||
},
|
||||
}))
|
||||
const wrapper = mount(Players)
|
||||
await wrapper.vm.$nextTick()
|
||||
wrapper.find('.btn-warning').trigger('click')
|
||||
expect(window.$).toBeCalled()
|
||||
})
|
||||
|
||||
test('delete player', async () => {
|
||||
Vue.prototype.$http.get
|
||||
.mockResolvedValueOnce([
|
||||
|
@ -20,7 +20,6 @@ const config = {
|
||||
'@fortawesome/fontawesome-free/css/fontawesome.min.css',
|
||||
'@fortawesome/fontawesome-free/css/regular.min.css',
|
||||
'@fortawesome/fontawesome-free/css/solid.min.css',
|
||||
'icheck/skins/square/blue.css',
|
||||
'./resources/assets/src/stylus/common.styl',
|
||||
],
|
||||
setup: './resources/assets/src/stylus/setup.styl',
|
||||
|
@ -4438,10 +4438,6 @@ https-browserify@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
|
||||
|
||||
icheck@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/icheck/-/icheck-1.0.2.tgz#06d08da3d47ae448c153b2639b86e9ad7fdf7128"
|
||||
|
||||
iconv-lite@0.4.23:
|
||||
version "0.4.23"
|
||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63"
|
||||
|
Loading…
Reference in New Issue
Block a user