From d8c028fb4e36b71ed0db1e4e298a858d15765480 Mon Sep 17 00:00:00 2001 From: chenbiao Date: Thu, 26 Jul 2018 16:20:36 +0800 Subject: [PATCH] 编辑 提交 切换 --- topages/workfill/workfill.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/topages/workfill/workfill.js b/topages/workfill/workfill.js index c476b0c..a9cc26a 100644 --- a/topages/workfill/workfill.js +++ b/topages/workfill/workfill.js @@ -47,16 +47,21 @@ $('#time-opr-prevbtn').on('click',function () { $('#time-opr-nextbtn').on('click',function () { fun.timeoprnextbtn(); }); + //提交事件 -$('.workfill-list-btn').on('click',function () { +$(document).on('click','.workfill-list-btn',function () { var _this=$(this); - console.log(_this); - if($('.workfill-projectCon').hasClass('display-none')){ + if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ _this.text('提交'); + _this.parent().parent().find(".workfill-list-container").attr("contenteditable","true"); }else { _this.text('编辑'); + _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); } _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); + var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').toggleClass('display-none'); + _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); + }); -- libgit2 0.21.4