From 0c408581ae6126049a32cf6c2c6468e71f043a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 16 Aug 2019 10:36:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesLeftNav.js | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 282024b6d..b28472f66 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -680,22 +680,26 @@ class Coursesleftnav extends Component{ // course_modules:newcourse_modules // }) - if(result.source.droppableId==="shixun_homework"||result.source.droppableId==="graduation"||result.source.droppableId==="attachment"){ + if(result.source.droppableId==="shixun_homework"||result.source.droppableId==="graduation"||result.source.droppableId==="attachment"){ - let url ="/course_second_categories/"+result.draggableId+"/move_category.json" - this.droppablepost(url,result.destination.index+1) - - }else if(result.source.droppableId==="board"){ - - let url ="/boards/"+result.draggableId+"/move_category.json" - this.droppablepost(url,result.destination.index+1) + let url ="/course_second_categories/"+result.draggableId+"/move_category.json"; + if(result.destination.index!=null){ + this.droppablepost(url,result.destination.index+1) + } + }else if(result.source.droppableId==="board"){ - }else if(result.source.droppableId==="course_group"){ + let url ="/boards/"+result.draggableId+"/move_category.json"; + if(result.destination.index!=null) { + this.droppablepost(url, result.destination.index + 1) + } + }else if(result.source.droppableId==="course_group"){ if(result.draggableId!=1){ - let url ="/course_groups/"+result.draggableId+"/move_category.json" - this.droppablepost(url,result.destination.index+1) + let url ="/course_groups/"+result.draggableId+"/move_category.json"; + if(result.destination.index!=null) { + this.droppablepost(url, result.destination.index + 1) + } } - } + } }