<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
			<channel>
			<title>Как сменить label на checkbox по клику / Вопросы, проблемы и их решения / Alto CMS</title>
			<link>http://79.174.14.219/comments/681/</link>
			<description><![CDATA[Подскажите, добрые люди, я хочу сделать кнопку Подписаться (на коментарии). Добился, что по клику label меняется на Отписаться и обратно,]]></description>
			<language>ru</language>
			<managingEditor>noreply@altocms.ru</managingEditor>
			<webMaster>noreply@altocms.ru</webMaster>
			<generator>Alto CMS v.1.5.0b1</generator>
							<item>
					<title>Как сменить label на checkbox по клику (comment #12328)</title>
					<guid isPermaLink="true">http://79.174.14.219/t/681/#comment12328</guid>
					<link>http://79.174.14.219/681.html#comment12328</link>
					<author>markus1024@yandex.ru</author>
					<description><![CDATA[Что бы при перезагрузке «не слетало», вам еще нужно внести правки (как я понял по описанию проблемы) в сам шаблон, который отображает данные при загрузке страницы.]]></description>
					<pubDate>Tue, 29 Jul 2014 09:20:14 +0400</pubDate>
									</item>
							<item>
					<title>Как сменить label на checkbox по клику (comment #12332)</title>
					<guid isPermaLink="true">http://79.174.14.219/t/681/#comment12332</guid>
					<link>http://79.174.14.219/681.html#comment12332</link>
					<author>braindep@gmail.com</author>
					<description><![CDATA[В примере кода — и есть шаблон, который оборажает. Так какие правки туда вносить?]]></description>
					<pubDate>Tue, 29 Jul 2014 11:25:08 +0400</pubDate>
									</item>
							<item>
					<title>Как сменить label на checkbox по клику (comment #12357)</title>
					<guid isPermaLink="true">http://79.174.14.219/t/681/#comment12357</guid>
					<link>http://79.174.14.219/681.html#comment12357</link>
					<author>braindep@gmail.com</author>
					<description><![CDATA[Вопрос решен, кому интересно — обращайтесь]]></description>
					<pubDate>Wed, 30 Jul 2014 21:02:22 +0400</pubDate>
									</item>
							<item>
					<title>Как сменить label на checkbox по клику (comment #12454)</title>
					<guid isPermaLink="true">http://79.174.14.219/t/681/#comment12454</guid>
					<link>http://79.174.14.219/681.html#comment12454</link>
					<author>ametmastaba@gmail.com</author>
					<description><![CDATA[интересно. расскажите, плз]]></description>
					<pubDate>Sat, 02 Aug 2014 16:37:44 +0400</pubDate>
									</item>
							<item>
					<title>Как сменить label на checkbox по клику (comment #12476)</title>
					<guid isPermaLink="true">http://79.174.14.219/t/681/#comment12476</guid>
					<link>http://79.174.14.219/681.html#comment12476</link>
					<author>braindep@gmail.com</author>
					<description><![CDATA[Меняем файл common/templates/skin/experience/tpls/comments/comment.tree.tpl и стили к нему.<br/>
<pre class="prettyprint"><code>{if $bAllowSubscribe AND E::IsUser()}
             &lt;script&gt;
                 $(function(){
-                    $('#comment_track').on('ifChanged', function(e) { $('#comment_track').trigger('change'); });
-                    $('#comment_subscribe').on('ifChanged', function(e) { $('#comment_subscribe').trigger('change'); });
+                    ls.hook.add('ls_track_toggle_after', function (type, id, value) {
+                        if (value) {
+                            $('#comment_track').addClass('active').val('Отписаться');
+                        } else {
+                            $('#comment_track').removeClass('active').val('Подписаться');
+                        }
+                    });
                 })
             &lt;/script&gt;
-            &lt;ul class=&quot;comment-subscribe&quot;&gt;
-                &lt;li class=&quot;long-text&quot;&gt;{$aLang.comment_whatch}:&lt;/li&gt;
-                &lt;li class=&quot;short-text&quot;&gt;{$aLang.comment_whatch_short}:&lt;/li&gt;
-                &lt;li&gt;
-                    &lt;label&gt;
-                        &lt;input {if $oTrackComment AND $oTrackComment-&gt;getStatus()}checked=&quot;checked&quot;{/if}
-                               type=&quot;checkbox&quot; id=&quot;comment_track&quot; class=&quot;input-checkbox&quot;
-                               onchange=&quot;ls.subscribe.tracktoggle('{$sTargetType}_new_comment','{$iTargetId}',this.checked);&quot;&gt;
-                        {$aLang.comment_track}
-                    &lt;/label&gt;
-                &lt;/li&gt;
-                &lt;li&gt;
-                    &lt;label&gt;
-                        &lt;input {if $oSubscribeComment AND $oSubscribeComment-&gt;getStatus()}checked=&quot;checked&quot;{/if}
-                               type=&quot;checkbox&quot; id=&quot;comment_subscribe&quot; class=&quot;input-checkbox&quot;
-                               onchange=&quot;ls.subscribe.toggle('{$sTargetType}_new_comment','{$iTargetId}','',this.checked);&quot;&gt;
-                        {$aLang.comment_subscribe}
-                    &lt;/label&gt;
-                &lt;/li&gt;
-            &lt;/ul&gt;
+            {$buttonClass=''}
+            {$buttonText='Подписаться'}
+            {if $oTrackComment AND $oTrackComment-&gt;getStatus()}
+                {$buttonText='Отписаться'}
+                {$buttonClass='active'}
+            {/if}
+            &lt;input type=&quot;button&quot; value=&quot;{$buttonText}&quot; class=&quot;{$buttonClass}&quot; id=&quot;comment_track&quot;
+            onclick=&quot;ls.subscribe.tracktoggle('{$sTargetType}_new_comment','{$iTargetId}',!$(this).hasClass('active'));&quot;/&gt;
         {/if}
     &lt;/div&gt;
 &lt;/div&gt;
</code></pre>]]></description>
					<pubDate>Sun, 03 Aug 2014 22:16:47 +0400</pubDate>
									</item>
							<item>
					<title>Как сменить label на checkbox по клику (comment #12664)</title>
					<guid isPermaLink="true">http://79.174.14.219/t/681/#comment12664</guid>
					<link>http://79.174.14.219/681.html#comment12664</link>
					<author>ametmastaba@gmail.com</author>
					<description><![CDATA[спасибо]]></description>
					<pubDate>Fri, 08 Aug 2014 21:41:26 +0400</pubDate>
									</item>
							<item>
					<title>Как сменить label на checkbox по клику (comment #12477)</title>
					<guid isPermaLink="true">http://79.174.14.219/t/681/#comment12477</guid>
					<link>http://79.174.14.219/681.html#comment12477</link>
					<author>braindep@gmail.com</author>
					<description><![CDATA[Только что заметил, что можно сделать так, как сделано на кнопе «Свернуть все ветки» в комментариях.]]></description>
					<pubDate>Sun, 03 Aug 2014 22:26:36 +0400</pubDate>
									</item>
					</channel>
	</rss>
