Файл: static/js/custom/news.js
Строк: 49
<?php
$("#page_news").on("click","#delete",function(){$.get("/modules/news_category_delete/?id="+category,function(){load_categories(true)})});$("#page_news").on("taphold","#categories li",function(){if($("#page_news").attr("data-admin")==0){return}category=$(this).attr("data-id");$("#page_news #popup").popup("open",{positionTo:"window",transition:"flip"})});$("#page_news").bind("pageshow",function(){load_categories(true)});$("#page_news").bind("pagehide",function(){$("#page_news").remove()});function load_categories(a){if(a){$.mobile.showPageLoadingMsg()}$.getJSON("/modules/news_category_get/",function(c){if(c=="false"){if(a){$.mobile.hidePageLoadingMsg()}return}var b="";b+='<ul data-role="listview" data-inset="true"><li data-role="list-divider">Категории</li>';$.each(c,function(d,e){b+='<li data-icon="false" data-id="'+e.id+'"><a href="/news_category/?category='+e.id+'"><h3>'+e.name+"</h3>";if(e.about!=""){b+="<p>"+e.about+"</p>"}b+='<span class="ui-li-count">'+e.count+"</span></a></li>"});b+="</ul>";$("#categories").html(b).trigger("create").trigger("refresh");if(a){$.mobile.hidePageLoadingMsg()}})};
?>