Вход Регистрация
Файл: static/js/custom/files_edit.js
Строк: 71
<?php
var n=0;var max_n=0;var e=10;$("#page_files_edit").bind("pageshow",function(){e=parseInt($("#files").attr("data-e"));load_files(0,true)});$("#page_files_edit").on("change","input,textarea",function(){var c=$(this).attr("data-id");var b=$(this).attr("name");var a=$(this).val();if((b=="name"&&a!="")||b=="description"){if(b=="name"){$("li#"+c+" h3").html(a).trigger("create").trigger("refresh");$("li#"+c).prev().html(a).trigger("create").trigger("refresh")}if(b=="description"){$("li#"+c).find("p#about").html(a).trigger("create").trigger("refresh")}$.ajax({url:"/modules/file_update/",type:"POST",cache:false,dataType:"json",data:{field:b,value:a,id:c},success:show_result})}});$("#page_files_edit").bind("pagehide",function(){$("#page_files_edit").remove()});$("#page_files_edit #next").on("click",next_page);$("#page_files_edit #back").on("click",back_page);$("#page_files_edit").on("swipeleft","#files",back_page);$("#page_files_edit").on("swiperight","#files",next_page);$("#page_files_edit").on("focusin","input,textarea",function(){$("#page_files_edit").off("swipeleft");$("#page_files_edit").off("swiperight")});$("#page_files_edit").on("focusout","input,textarea",function(){$("#page_files_edit").on("swipeleft","#files",back_page);$("#page_files_edit").on("swiperight","#files",next_page)});function load_files(b,a){if(a){$.mobile.showPageLoadingMsg()}$.get("/modules/files_edit/?category="+$("#files").attr("data-category")+"&n="+b,function(c){$("#files").html(c).trigger("create").trigger("refresh");max_n=$("#files_list").attr("data-max");update_navigation();if(a){$.mobile.hidePageLoadingMsg()}})}function show_result(a){if(a!="true"){alert_message(a,"information",3)}}function next_page(){if((n-e)<0){return}n=n-e;load_files(n,true)}function back_page(){if((n+e)>=max_n){return}n=n+e;load_files(n,true)};
?>
Онлайн: 0
Реклама