Completed
Push — master ( 968494...b3d85d )
by Ajeh
21s
created

???.computed.leftBtnEnabled   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 2
dl 0
loc 3
rs 10
nop 0
1
/**
2
 * Created by Emmy on 3/5/2018.
3
 */
4
5
import {DIALOG_TYPES, CONFIRM_TYPES} from '../constants'
6
7
export default {
8
    computed: {
9
        cancelBtnDisabled(){
10
            return (this.options.window === DIALOG_TYPES.ALERT)
11
        },
12
        okBtnDisabled(){
13
            return (this.options.window === DIALOG_TYPES.CONFIRM)
14
                && (this.options.type === CONFIRM_TYPES.HARD)
15
                && (this.input !== this.options.verification)
16
        },
17
        leftBtnEnabled(){
18
            return (this.cancelBtnDisabled === false) || (this.options.reverse === true)
19
        },
20
        rightBtnEnabled(){
21
            return (this.cancelBtnDisabled === false) || (this.options.reverse === false)
22
        },
23
        leftBtnFocus(){
24
            return !this.isHardConfirm && (this.options.reverse === true)
25
        },
26
        rightBtnFocus(){
27
            return !this.isHardConfirm && (this.options.reverse === false)
28
        },
29
        leftBtnText(){
30
            return this.options.reverse ? this.options.okText : this.options.cancelText
31
        },
32
        rightBtnText(){
33
            return this.options.reverse ? this.options.cancelText : this.options.okText
34
        }
35
    }
36
}