diff --git a/hourglass/client/main/main.js b/hourglass/client/main/main.js index c218049..a91dd57 100644 --- a/hourglass/client/main/main.js +++ b/hourglass/client/main/main.js @@ -93,9 +93,11 @@ Template.registerHelper('myClasses', () => { for(var i = 0; i < courses.length; i++) { found = classes.findOne({_id:courses[i]}); found.subscribers = found.subscribers.length/17; - - if(found.admin === Meteor.userId()) found.box = " owned"; found.mine = true; + if(found.admin === Meteor.userId()) { + found.box = " owned"; + found.mine = false; + } array.push(found); var thisWork = work.find({class: courses[i]}).fetch(); diff --git a/hourglass/client/profile/profile.js b/hourglass/client/profile/profile.js index d5ca89e..2474c72 100644 --- a/hourglass/client/profile/profile.js +++ b/hourglass/client/profile/profile.js @@ -432,7 +432,10 @@ Template.profile.events({ } catch (err) {} }, 'click .classBox' (event) { - if (event.target.id === "label" || Session.get("profClassTab") === "manClass") return; + if (event.target.id === "label" || + Session.get("profClassTab") === "manClass" || + event.target.className.includes("fa-times")) return; + if (event.target.className !== "classBox") { var attribute = event.target.parentNode.getAttribute("classid"); } else { @@ -508,8 +511,11 @@ Template.profile.events({ }, 'click .classBox .fa-times' (event) { var box = event.target.parentNode; + var classid = box.getAttribute("classid"); Session.set("serverData", box.getAttribute("classid")); - sendData("leaveClass"); + Session.set("confirm","leaveClass"); + Session.set("confirmText", "Leave this class?"); + openDivFade(document.getElementsByClassName("overlay")[0]); }, 'click .userBox .fa-times' (event) { var box = event.target.parentNode;