aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/static/js
diff options
context:
space:
mode:
authorJef van Schendel <mail@jefvanschendel.nl>2012-04-01 16:02:23 +0200
committerJef van Schendel <mail@jefvanschendel.nl>2012-04-01 16:02:23 +0200
commitd297d8e834a03692b7a0f0e83d394f5413ed7abc (patch)
tree04a5845f91ca710a401f1d75b95b4807f1fedb54 /mediagoblin/static/js
parente79d69739e04a2042b4a93a27191d71128a12de4 (diff)
downloadmediagoblin-d297d8e834a03692b7a0f0e83d394f5413ed7abc.tar.lz
mediagoblin-d297d8e834a03692b7a0f0e83d394f5413ed7abc.tar.xz
mediagoblin-d297d8e834a03692b7a0f0e83d394f5413ed7abc.zip
Add dropdown to header
Diffstat (limited to 'mediagoblin/static/js')
-rw-r--r--mediagoblin/static/js/header_dropdown.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/mediagoblin/static/js/header_dropdown.js b/mediagoblin/static/js/header_dropdown.js
new file mode 100644
index 00000000..57385203
--- /dev/null
+++ b/mediagoblin/static/js/header_dropdown.js
@@ -0,0 +1,33 @@
+/**
+ * GNU MediaGoblin -- federated, autonomous media hosting
+ * Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+$(document).ready(function() {
+ $(".dropdown_items").hide();
+ $(".dropdown").click(function(e) {
+ e.preventDefault();
+ $(".dropdown_items").toggle();
+ });
+ $(".dropdown_items").mouseup(function() {
+ return false
+ });
+ $(document).mouseup(function(e) {
+ if($(e.target).not(".dropdown_items")) {
+ $(".dropdown_items").hide();
+ }
+ });
+});