Skip to content

Commit

Permalink
Add a button at the bottom of the sidebar for users to give feedback,
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-wu committed May 13, 2019
1 parent 1807e99 commit 80007bd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/snippets/managerSidebar.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<div class="w3-sidebar w3-bar-block w3-animate-left sidebar" id="managerSidebar">
<button class="w3-bar-item w3-button w3-large" id="sidebarClose">Close &times;</button>

<button class="w3-bar-item w3-button" id="addManager">+ Add Manager</button>

<button class="w3-bar-item w3-button sidebar-topbutton" id="addManager">+ Add Manager</button>
<div style="width:100%;position:absolute;bottom:1%;">
<button class="w3-bar-item w3-button sidebar-topbutton" id="Feedback" style="text-align:center!important;">Feedback</button>
</div>

</div>

<div>
Expand Down
4 changes: 2 additions & 2 deletions src/styles/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
position:relative!important;
}

#addManager {
.sidebar-topbutton {
border-radius: 5px;
}

#addManager:hover {background-color: #b2d8ff !important;}
.sidebar-topbutton:hover {background-color: #b2d8ff !important;}
17 changes: 17 additions & 0 deletions src/ui/ManagerSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ var ManagerSidebar = function(parentIn) {
var addManagerDialog = undefined;
var messageDialog = undefined;
var ManagerElementArray = [];
var feedbackCallback = undefined;
var _this = this;

this.open = function() {
Expand Down Expand Up @@ -228,6 +229,8 @@ var ManagerSidebar = function(parentIn) {
};
element = jelem.find("#addManager")[0];
element.onclick = addManagerClicked();
element = jelem.find("#Feedback")[0];
element.onclick = feedbackClicked();
}

var addDialogCallback = function() {
Expand Down Expand Up @@ -270,6 +273,20 @@ var ManagerSidebar = function(parentIn) {
}
}

this.setFeedbackClickedCallback = function(callback) {
feedbackCallback = callback;
}

var feedbackClicked = function() {
return function(event) {
event.stopPropagation();
if (feedbackCallback) {
feedbackCallback();
}
}
}


var renameDialogCallback = function() {
var nameElem = renameDialog.find("#new_name")[0];
var managerItem = renameDialog.data("managerItem");
Expand Down

0 comments on commit 80007bd

Please sign in to comment.