mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11103] Create common.js for subsilver2, move added JS code there
PHPBB3-11103
This commit is contained in:
parent
471ca5e7dc
commit
a93067eb41
3 changed files with 20 additions and 19 deletions
18
phpBB/styles/subsilver2/template/common.js
Normal file
18
phpBB/styles/subsilver2/template/common.js
Normal file
|
@ -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
|
|
@ -10,25 +10,8 @@
|
||||||
|
|
||||||
<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
|
<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 -->
|
<!-- 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}
|
{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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -150,7 +150,7 @@ function marklist(id, name, state)
|
||||||
<tr>
|
<tr>
|
||||||
<td class="genmed">
|
<td class="genmed">
|
||||||
<!-- IF S_NOTIFICATIONS_DISPLAY -->
|
<!-- IF S_NOTIFICATIONS_DISPLAY -->
|
||||||
[ <a href="#" id="notification_list_button" title="{NOTIFICATIONS_COUNT}" onclick="$('#notification_list').toggle(); return false;">{NOTIFICATIONS_COUNT}</a> ] •
|
[ <a href="#" id="notification_list_button" title="{NOTIFICATIONS_COUNT}">{NOTIFICATIONS_COUNT}</a> ] •
|
||||||
<div id="notification_list" class="notification_list">
|
<div id="notification_list" class="notification_list">
|
||||||
<div class="row1 header">
|
<div class="row1 header">
|
||||||
{L_NOTIFICATIONS}
|
{L_NOTIFICATIONS}
|
||||||
|
|
Loading…
Add table
Reference in a new issue