@@ -221,7 +221,7 @@ CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
221
221
that . options . onSkipClick ( ) ;
222
222
} ) ;
223
223
224
- that . $prev_btn = $ ( "<div>" , { class : that . cl . previous_btn } )
224
+ that . $prev_btn = $ ( "<div>" , { class : that . cl . previous_btn } )
225
225
. appendTo ( that . enjoyhint )
226
226
. html ( "Previous" )
227
227
. click ( function ( e ) {
@@ -282,6 +282,7 @@ CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
282
282
$ ( window ) . on ( "resize" , function ( ) {
283
283
clearTimeout ( doit ) ;
284
284
$ ( '.enjoyhint_next_btn' ) . css ( 'visibility' , 'hidden' ) ;
285
+ $ ( '.enjoyhint_prev_btn' ) . css ( 'visibility' , 'hidden' ) ;
285
286
$ ( '.enjoyhint_skip_btn' ) . css ( 'visibility' , 'hidden' ) ;
286
287
$ ( '.enjoy_hint_label' ) . remove ( )
287
288
$ ( "#enjoyhint_arrpw_line" ) . remove ( )
@@ -314,6 +315,7 @@ CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
314
315
315
316
that . renderLabelWithShape ( that . stepData ) ;
316
317
$ ( '.enjoyhint_next_btn' ) . css ( 'visibility' , 'visible' ) ;
318
+ $ ( '.enjoyhint_prev_btn' ) . css ( 'visibility' , 'visible' ) ;
317
319
$ ( '.enjoyhint_skip_btn' ) . css ( 'visibility' , 'visible' ) ;
318
320
}
319
321
@@ -791,7 +793,7 @@ CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
791
793
var bottom_offset = body_size . h - ( data . center_y + half_h ) ;
792
794
var left_offset = data . center_x - half_w ;
793
795
var right_offset = body_size . w - ( data . center_x + half_w ) ;
794
-
796
+
795
797
var label_shift = 150 ;
796
798
var label_margin = 40 ;
797
799
var label_shift_with_label_height =
@@ -808,7 +810,6 @@ CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
808
810
{ name : 'center_top' , common_area : window . innerWidth * top_offset , width : window . innerWidth , height : top_offset } ,
809
811
{ name : 'center_bottom' , common_area : window . innerWidth * bottom_offset , width : window . innerWidth , height : bottom_offset } ,
810
812
] ;
811
-
812
813
var label_horizontal_space_required = label_width ;
813
814
var label_vertical_space_required = label_shift_with_label_height + 20 ;
814
815
@@ -916,7 +917,6 @@ CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
916
917
917
918
x_from = label_x + label_width / 2 ;
918
919
y_from = ( data . center_y > label_y + label_height / 2 ) ? label_y + label_height : label_y ;
919
-
920
920
// if data center out of window y scale
921
921
if ( data . center_y < 0 ) {
922
922
y_to = 20
@@ -949,27 +949,43 @@ CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
949
949
if ( summoryButtonWidth + distance > window . innerWidth || distance < 0 ) {
950
950
distance = 10 ;
951
951
ver_button_position = y_from < y_to ? label_y - 80 : label_y + label_height + 40
952
- }
952
+ }
953
953
954
- that . $next_btn . css ( {
954
+ var initial_distance = distance ;
955
+ var initial_ver_position = ver_button_position ;
956
+
957
+ if ( window . innerWidth <= 640 ) {
958
+ distance = 10 ;
959
+ ver_button_position = 10 ;
960
+ that . $next_btn . html ( '›' ) ;
961
+ that . $prev_btn . html ( '‹' ) ;
962
+ }
963
+ else {
964
+ distance = initial_distance ;
965
+ ver_button_position = initial_ver_position ;
966
+ that . $next_btn . html ( 'Next' ) ;
967
+ that . $prev_btn . html ( 'Previous' ) ;
968
+ }
969
+
970
+ that . $prev_btn . css ( {
955
971
left : distance ,
956
972
top : ver_button_position
957
973
} ) ;
958
974
959
- var prev_skip = distance + that . $next_btn . width ( ) + 10 ;
960
- var left_skip = distance + that . $next_btn . width ( ) + that . $prev_btn . width ( ) + 20 ;
975
+ var left_next = distance + that . $prev_btn . width ( ) + 10 ;
976
+ var left_skip = distance + that . $prev_btn . width ( ) + that . $next_btn . width ( ) + 20 ;
961
977
962
978
if ( that . nextBtn === "hide" ) {
963
- prev_skip = distance ;
964
979
left_skip = distance + that . $prev_btn . width ( ) + 10 ;
965
980
}
966
981
967
982
if ( that . prevBtn === "hide" ) {
968
- left_skip = distance + that . $next_btn . width ( ) + 10
983
+ left_next = distance ;
984
+ left_skip = distance + that . $next_btn . width ( ) + 10 ;
969
985
}
970
986
971
- that . $prev_btn . css ( {
972
- left : prev_skip ,
987
+ that . $next_btn . css ( {
988
+ left : left_next ,
973
989
top : ver_button_position
974
990
} )
975
991
0 commit comments