aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-10-19 16:00:37 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2012-10-19 16:00:37 -0500
commita93067eb4196454c147ea516733182abd1612e84 (patch)
treefc42444991678659008d0c6012df61d4f0503c6e
parent471ca5e7dc8276e80e790e05a2ae36dfe35cfe10 (diff)
downloadforums-a93067eb4196454c147ea516733182abd1612e84.tar
forums-a93067eb4196454c147ea516733182abd1612e84.tar.gz
forums-a93067eb4196454c147ea516733182abd1612e84.tar.bz2
forums-a93067eb4196454c147ea516733182abd1612e84.tar.xz
forums-a93067eb4196454c147ea516733182abd1612e84.zip
[ticket/11103] Create common.js for subsilver2, move added JS code there
PHPBB3-11103
-rw-r--r--phpBB/styles/subsilver2/template/common.js18
-rw-r--r--phpBB/styles/subsilver2/template/overall_footer.html19
-rw-r--r--phpBB/styles/subsilver2/template/overall_header.html2
3 files changed, 20 insertions, 19 deletions
diff --git a/phpBB/styles/subsilver2/template/common.js b/phpBB/styles/subsilver2/template/common.js
new file mode 100644
index 0000000000..c9e6221e2e
--- /dev/null
+++ b/phpBB/styles/subsilver2/template/common.js
@@ -0,0 +1,18 @@
+(function($) { // Avoid conflicts with other libraries
+
+"use strict";
+
+// Toggle notification list
+$('#notification_list_button').click(function(e) {
+ $('#notification_list').toggle();
+ e.preventDefault();
+});
+$(document).click(function(e) {
+ var target = e.target;
+
+ if (!$(target).is('#notification_list') && !$(target).is('#notification_list_button') && !$(target).parents().is('#notification_list')) {
+ $('#notification_list').hide();
+ }
+});
+
+})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/styles/subsilver2/template/overall_footer.html b/phpBB/styles/subsilver2/template/overall_footer.html
index 11989feca6..8cc5591478 100644
--- a/phpBB/styles/subsilver2/template/overall_footer.html
+++ b/phpBB/styles/subsilver2/template/overall_footer.html
@@ -10,25 +10,8 @@
<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+<!-- INCLUDEJS template/common.js -->
{SCRIPTS}
-<script type="text/javascript">
-// <![CDATA[
-<!-- IF S_NOTIFICATIONS_DISPLAY -->
-(function($) { // Avoid conflicts with other libraries
-
-$(document).click(function(e) {
- var target = e.target;
-
- if (!$(target).is('#notification_list') && !$(target).is('#notification_list_button') && !$(target).parents().is('#notification_list')) {
- $('#notification_list').hide();
- }
-});
-
-})(jQuery); // Avoid conflicts with other libraries
-<!-- ENDIF -->
-// ]]>
-</script>
-
</body>
</html>
diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html
index aec754c444..a48828bb3a 100644
--- a/phpBB/styles/subsilver2/template/overall_header.html
+++ b/phpBB/styles/subsilver2/template/overall_header.html
@@ -150,7 +150,7 @@ function marklist(id, name, state)
<tr>
<td class="genmed">
<!-- IF S_NOTIFICATIONS_DISPLAY -->
- [ <a href="#" id="notification_list_button" title="{NOTIFICATIONS_COUNT}" onclick="$('#notification_list').toggle(); return false;">{NOTIFICATIONS_COUNT}</a> ] &bull;
+ [ <a href="#" id="notification_list_button" title="{NOTIFICATIONS_COUNT}">{NOTIFICATIONS_COUNT}</a> ] &bull;
<div id="notification_list" class="notification_list">
<div class="row1 header">
{L_NOTIFICATIONS}