summaryrefslogtreecommitdiff
path: root/assets/js/src/Sidebar.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/src/Sidebar.js')
-rw-r--r--assets/js/src/Sidebar.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/assets/js/src/Sidebar.js b/assets/js/src/Sidebar.js
new file mode 100644
index 00000000..0794d6b3
--- /dev/null
+++ b/assets/js/src/Sidebar.js
@@ -0,0 +1,25 @@
+function Sidebar() {
+}
+
+Sidebar.prototype.expand = function(e) {
+ e.preventDefault();
+ $(".sidebar-container").removeClass("sidebar-collapsed");
+ $(".sidebar-collapse").show();
+ $(".sidebar h2").show();
+ $(".sidebar ul").show();
+ $(".sidebar-expand").hide();
+};
+
+Sidebar.prototype.collapse = function(e) {
+ e.preventDefault();
+ $(".sidebar-container").addClass("sidebar-collapsed");
+ $(".sidebar-expand").show();
+ $(".sidebar h2").hide();
+ $(".sidebar ul").hide();
+ $(".sidebar-collapse").hide();
+};
+
+Sidebar.prototype.listen = function() {
+ $(document).on("click", ".sidebar-collapse", this.collapse);
+ $(document).on("click", ".sidebar-expand", this.expand);
+};