Файл: static/js/custom/pages_list.js
Строк: 66
<?php
var n=0;var max_n=0;var e=10;$("#page_pages_list").on("click","#delete",function(){$.get("/modules/pages_delete/?id="+page,function(){load_pages(n,true)})});$("#page_pages_list").bind("pageshow",function(){e=parseInt($("#pages").attr("data-e"));load_pages(0,true)});$("#page_pages_list #next").on("click",next_page);$("#page_pages_list #back").on("click",back_page);$("#page_pages_list").on("swipeleft","#pages",back_page);$("#page_pages_list").on("swiperight","#pages",next_page);$("#page_pages_list").bind("pagehide",function(){$("#page_pages_list").remove()});$("#page_pages_list").on("taphold","#pages_list li",function(){if($("#page_pages_list").attr("data-admin")==0){return}page=$(this).attr("data-id");$("#page_pages_list #popup").popup("open",{positionTo:"window",transition:"flip"})});function load_pages(b,a){if(a){$.mobile.showPageLoadingMsg()}$.getJSON("/modules/pages_list/?n="+b,function(d){var c="";$.each(d,function(f,g){if(f==0){c+='<ul data-role="listview" id="pages_list" data-inset="true" data-max="'+g+'"><li data-role="list-divider">Страницы</li>';max_n=g}else{c+='<li data-id="'+g.id+'" data-icon="false"><a href="'+g.url+'"><h3 style="font-size: 14px">'+g.title+"</h3><p>"+g.description+"</p></a></li>"}});if(max_n==0){c+="<li>Страниц нет.</li>"}c+="</ul>";$("#pages").html(c).trigger("create").trigger("refresh");update_navigation();if(a){$.mobile.hidePageLoadingMsg()}})}function next_page(){if((n-e)<0){return}n=n-e;load_pages(n,true)}function back_page(){if((n+e)>=max_n){return}n=n+e;load_pages(n,true)};
?>