File tree Expand file tree Collapse file tree 3 files changed +48
-15
lines changed Expand file tree Collapse file tree 3 files changed +48
-15
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ module.exports = Behavior({
4
4
time : {
5
5
type : Date ,
6
6
value : new Date ( ) . getTime ( ) + 86400000 ,
7
- observer :function ( newVal , oldVal ) {
8
- if ( newVal && ! oldVal ) {
7
+ observer : function ( newVal , oldVal ) {
8
+ if ( newVal && ! oldVal ) {
9
9
this . getLatestTime ( ) ;
10
10
}
11
11
}
@@ -36,6 +36,10 @@ module.exports = Behavior({
36
36
countdownType : {
37
37
type : String ,
38
38
value : "normal"
39
+ } ,
40
+ isClearInterval : {
41
+ type : Boolean ,
42
+ value : true
39
43
}
40
44
} ,
41
45
data : {
@@ -48,15 +52,22 @@ module.exports = Behavior({
48
52
} ,
49
53
50
54
detached : function ( ) {
51
- clearInterval ( this . data . timer ) ;
55
+ if ( this . data . isClearInterval ) {
56
+ clearInterval ( this . data . timer ) ;
57
+ }
52
58
} ,
53
59
54
60
pageLifetimes : {
55
61
hide ( ) {
56
- clearInterval ( this . data . timer ) ;
62
+ if ( this . data . isClearInterval ) {
63
+ clearInterval ( this . data . timer ) ;
64
+ }
65
+
57
66
} ,
58
67
show ( ) {
59
- this . getLatestTime ( ) ;
68
+ if ( this . data . isClearInterval ) {
69
+ this . getLatestTime ( ) ;
70
+ }
60
71
}
61
72
} ,
62
73
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ module.exports = Behavior({
4
4
time : {
5
5
type : Date ,
6
6
value : new Date ( ) . getTime ( ) + 86400000 ,
7
- observer :function ( newVal , oldVal ) {
8
- if ( newVal && ! oldVal ) {
7
+ observer : function ( newVal , oldVal ) {
8
+ if ( newVal && ! oldVal ) {
9
9
this . getLatestTime ( ) ;
10
10
}
11
11
}
@@ -36,6 +36,10 @@ module.exports = Behavior({
36
36
countdownType : {
37
37
type : String ,
38
38
value : "normal"
39
+ } ,
40
+ isClearInterval : {
41
+ type : Boolean ,
42
+ value : true
39
43
}
40
44
} ,
41
45
data : {
@@ -48,15 +52,22 @@ module.exports = Behavior({
48
52
} ,
49
53
50
54
detached : function ( ) {
51
- clearInterval ( this . data . timer ) ;
55
+ if ( this . data . isClearInterval ) {
56
+ clearInterval ( this . data . timer ) ;
57
+ }
52
58
} ,
53
59
54
60
pageLifetimes : {
55
61
hide ( ) {
56
- clearInterval ( this . data . timer ) ;
62
+ if ( this . data . isClearInterval ) {
63
+ clearInterval ( this . data . timer ) ;
64
+ }
65
+
57
66
} ,
58
67
show ( ) {
59
- this . getLatestTime ( ) ;
68
+ if ( this . data . isClearInterval ) {
69
+ this . getLatestTime ( ) ;
70
+ }
60
71
}
61
72
} ,
62
73
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ module.exports = Behavior({
4
4
time : {
5
5
type : Date ,
6
6
value : new Date ( ) . getTime ( ) + 86400000 ,
7
- observer :function ( newVal , oldVal ) {
8
- if ( newVal && ! oldVal ) {
7
+ observer : function ( newVal , oldVal ) {
8
+ if ( newVal && ! oldVal ) {
9
9
this . getLatestTime ( ) ;
10
10
}
11
11
}
@@ -36,6 +36,10 @@ module.exports = Behavior({
36
36
countdownType : {
37
37
type : String ,
38
38
value : "normal"
39
+ } ,
40
+ isClearInterval : {
41
+ type : Boolean ,
42
+ value : true
39
43
}
40
44
} ,
41
45
data : {
@@ -48,15 +52,22 @@ module.exports = Behavior({
48
52
} ,
49
53
50
54
detached : function ( ) {
51
- clearInterval ( this . data . timer ) ;
55
+ if ( this . data . isClearInterval ) {
56
+ clearInterval ( this . data . timer ) ;
57
+ }
52
58
} ,
53
59
54
60
pageLifetimes : {
55
61
hide ( ) {
56
- clearInterval ( this . data . timer ) ;
62
+ if ( this . data . isClearInterval ) {
63
+ clearInterval ( this . data . timer ) ;
64
+ }
65
+
57
66
} ,
58
67
show ( ) {
59
- this . getLatestTime ( ) ;
68
+ if ( this . data . isClearInterval ) {
69
+ this . getLatestTime ( ) ;
70
+ }
60
71
}
61
72
} ,
62
73
You can’t perform that action at this time.
0 commit comments