Вход Регистрация
Файл: static/js/custom/photos_category.js
Строк: 52
<?php
var n=0;var max_n=0;var e=10;$("#page_photos_category").bind("pageshow",function(){e=parseInt($("#photos").attr("data-e"));load_photos(0,true)});$("#page_photos_category").bind("pagehide",function(){$("#page_photos_category").remove()});$("#page_photos_category #next").on("click",next_page);$("#page_photos_category #back").on("click",back_page);$("#page_photos_category").on("swipeleft","#photos",back_page);$("#page_photos_category").on("swiperight","#photos",next_page);function load_photos(b,a){if(a){$.mobile.showPageLoadingMsg()}$.getJSON("/modules/photos_get/?category="+$("#photos").attr("data-category")+"&n="+b,function(d){var c="";$.each(d,function(f,g){if(f==0){c+='<ul data-role="listview" id="photos_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+'"><img class="image-radius" src="/modules/photo_download/?id='+g.id+'&size=preview" alt=""><h3 style="font-size: 14px">'+g.name+"</h3><p>"+g.description+'</p><p class="ui-li-aside">'+g.date+"</p></a></li>"}});if(max_n==0){c+="<li>Фотографий нет.</li>"}c+="</ul>";$("#photos").html(c).trigger("create").trigger("refresh");update_navigation();if(a){$.mobile.hidePageLoadingMsg()}})}function next_page(){if((n-e)<0){return}n=n-e;load_photos(n,true)}function back_page(){if((n+e)>=max_n){return}n=n+e;load_photos(n,true)};
?>
Онлайн: 1
Реклама