Skip to content

Commit d3a38e6

Browse files
committed
chroe: add methods of components and optimization of code
1 parent 74b3c57 commit d3a38e6

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

projects/go-captcha-angular/src/lib/modules/click/click.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class ClickComponent {
3838
}
3939

4040
get hasDisplayImageState() {
41-
return this.localData.image != '' && this.localData.thumb != ''
41+
return this.localData.image != '' || this.localData.thumb != ''
4242
}
4343

4444
clickEvent(e: Event|any){

projects/go-captcha-angular/src/lib/modules/rotate/rotate.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
>
4141
<img
4242
[class]="{'gc-hide': localData.image == ''}"
43-
[style]="{display: hasDisplayImageState ? 'block' : 'none'}"
43+
[style]="{visibility: hasDisplayImageState ? 'visible' : 'hidden'}"
4444
[src]="localData.image"
4545
alt=""
4646
/>

projects/go-captcha-angular/src/lib/modules/rotate/rotate.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class RotateComponent {
135135
isMoving = false
136136
clearEvent()
137137

138-
if (currentAngle <= 0) {
138+
if (currentAngle < 0) {
139139
return
140140
}
141141

projects/go-captcha-angular/src/lib/modules/slide-region/slide-region.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export class SlideRegionComponent {
155155
isMoving = false
156156
clearEvent()
157157

158-
if (tileLeft <= 0 || tileTop <= 0) {
158+
if (tileLeft < 0 || tileTop < 0) {
159159
return
160160
}
161161

projects/go-captcha-angular/src/lib/modules/slide/slide.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export class SlideComponent {
145145
isMoving = false
146146
clearEvent()
147147

148-
if (currentThumbX <= 0) {
148+
if (currentThumbX < 0) {
149149
return
150150
}
151151

0 commit comments

Comments
 (0)