$(function(){ document.addEventListener('keydown', function(event) { if (event.ctrlKey && event.key === 's') { event.preventDefault(); $('.layui-btn_bg_save').click(); } }); $(document).on('click','.delete_file',function(){ //删除页面信息 $(this).parent().parent().remove(); }) $(document).on("click",".layui-sys-icon",function(){ var fclass = $(this).attr('data-field'); layer.tips($(this).attr('data-info'), '.'+fclass); }) $(document).on("mouseover",".layui-sys-icon",function(){ var fclass = $(this).attr('data-field'); layer.tips($(this).attr('data-info'), '.'+fclass); }) }) function get_fields(tid,id){ var id = arguments[1]?arguments[1]:0; $.post("{fun U('Fields/get_fields')}",{molds:'{$fields_biaoshi}',tid:tid,id:id},function(r){ $("#content_fields").html(r); }); } function get_fields_ext(tid,id){ var id = arguments[1]?arguments[1]:0; $.post("{fun U('Fields/get_fields')}",{molds:'{$fields_biaoshi}',tid:tid,id:id,isext:1},function(r){ $("#ext_fields").html(r); }); } function deleteImage_auto(elm,field){ $(elm).parent().prev().attr("src", "{__Tpl_style__}/style/images/nopic.jpg"); $('#'+field).val(""); $(elm).parent().hide(""); } function goleft(a){ var str = $(a).parent().parent().parent().attr('class'); var arr = $("."+str+" .upload-icon-img").toArray(); var index = $('.'+str+' .upload-icon-img').index($(a).closest('.upload-icon-img')); var temp; if(index-1>=0){ temp = arr[index]; arr[index] = arr[index-1]; arr[index-1] = temp; $(a).parent().parent().parent().html(arr) } } function goright(a){ var str = $(a).parent().parent().parent().attr('class'); var arr = $("."+str+" .upload-icon-img").toArray(); var index = $('.'+str+' .upload-icon-img').index($(a).closest('.upload-icon-img')); var temp; if(index+1