Blame view

frontend/web/js/script.js 4.38 KB
987739f1   Alexey Boroda   -Simple spoiler
1
2
3
  $(document).ready(

      function()

      {

9ceae125   Alexey Boroda   -Lazy load (now n...
4
5
6
7
          $('.lazy').Lazy({

              effect: 'fadeIn'

          });

  

987739f1   Alexey Boroda   -Simple spoiler
8
9
10
11
12
13
14
15
16
17
          $(".active").click(

              function()

              {

                  return false;

              }

          );

          $(".post_1 .more").click(

              function()

              {

                  $(this).parent().find('.spoiler').toggle(500);

f4c8962d   Alexey Boroda   -Spoiler fix
18
19
20
21
22
23
                  if($(this).hasClass('opened')) {

                      $('.more a').text('Узнать больше');

                  } else {

                      $('.more a').text('Скрыть');

                  }

                  $(this).toggleClass('opened');

987739f1   Alexey Boroda   -Simple spoiler
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
                  return false;

              }

          );

          $(".button2 a, .button3 a").click(

              function()

              {

                  $(this).toggleClass('opened');

                  $(this).parent().find('.spoiler').toggle(500);

                  $(this).parent().find(".checked").removeClass("checked");

                  return false;

              }

          );

          $('.spoiler input[type="radio"]').click(

              function()

              {

                  if($(this).is(":checked"))

                  {

                      $(this).parent().parent().find(".checked").removeClass("checked");

                      $(this).parent().addClass('checked');

                      return false;

                  } else

                  {

                      $(this).parent().removeClass('checked');

                      return false;

                  }

              }

          );

          $(".item-to-fade").hide();

          $(".more_colls").click(

              function()

              {

                  if($(this).hasClass('opened'))

                  {

                      $('.item-to-fade').hide();

                  } else

                  {

                      $('.item-to-fade').show();

                  }

                  $(this).toggleClass('opened');

                  $(this).parent().parent().find(".spoiler").toggle(500);

                  return false;

              }

          );

4ca21c3e   Alexey Boroda   first commit
67
  

987739f1   Alexey Boroda   -Simple spoiler
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
          $(".btn_otz.write").click(

              function()

              {

                  $(".add_comment").show();

                  $(this).parent().hide();

                  return false;

              }

          );

          $(".close_comm").click(

              function()

              {

                  $(this).parent().hide();

                  $(".otz_buttons").show();

                  return false;

              }

          );

          $(".btn_otz.more1").click(

              function()

              {

                  $(".hidden:lt(4)").removeClass("hidden");

                  if(!$(".hidden").is(".hidden"))

                  {

                      $(this).remove();

                  }

                  return false;

              }

          );

          $(".punkt").parent().find(".spoiler input[type='checkbox']:checked").parent().addClass("l_check").parent().parent().parent().show().parent().find(".punkt").addClass('opened');

7cf0d4f3   Eugeny Galkovskiy   123
96
  

987739f1   Alexey Boroda   -Simple spoiler
97
98
99
100
101
102
103
104
105
106
107
          if($('.spoiler-inner').length !== 0)

          {

              var spoilerLineHeight = parseInt($('.spoiler-inner').css('line-height').replace('px', ''));

              var spoilerFullHeight = parseInt($('.spoiler-inner').css('height').replace('px', ''));

              if(spoilerFullHeight < spoilerLineHeight * 3)

              {

                  $('.just-more').hide();

              } else

              {

                  $('.simple-spoiler').css('height', spoilerLineHeight * 3);

              }

7cf0d4f3   Eugeny Galkovskiy   123
108
          }

987739f1   Alexey Boroda   -Simple spoiler
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
          $(document).on(

              'click', '.just-more', function(event)

              {

                  event.preventDefault();

                  if($(".simple-spoiler").hasClass("just-closed"))

                  {

                      $('.just-more a').text("Скрыть");

                      $('.simple-spoiler').animate({height : spoilerFullHeight}, 1000);

                  } else

                  {

                      $('.just-more a').text("Узнать больше");

                      $('.simple-spoiler').animate({height : spoilerLineHeight * 3}, 1000)

                  }

                  $(".simple-spoiler").toggleClass("just-closed");

              }

          );

d992efc1   Eugeny Galkovskiy   123
125
126
          $(".hidemenu").click(function(){

              $(this).toggleClass("show");

1f292800   Eugeny Galkovskiy   123
127
              $(this).parent().find(".container").toggleClass("showed");

d992efc1   Eugeny Galkovskiy   123
128
          });

c63d541f   Eugeny Galkovskiy   123
129
130
131
          $(".menu a").click(function(){

              $(this).toggleClass("showmob");

          });

987739f1   Alexey Boroda   -Simple spoiler
132
133
      }

  );