aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm/style
diff options
context:
space:
mode:
authorVjacheslav Trushkin <cyberalien@gmail.com>2013-10-27 01:28:57 +0300
committerVjacheslav Trushkin <cyberalien@gmail.com>2013-11-02 22:31:39 +0200
commitb225dd37d765cc37beccb139e63432d78e0bc37e (patch)
tree789acc727f4bd0ec325de54c859e47320492e5a9 /phpBB/adm/style
parent25995e311ca136b64113d78e66a53df8f6a79b81 (diff)
downloadforums-b225dd37d765cc37beccb139e63432d78e0bc37e.tar
forums-b225dd37d765cc37beccb139e63432d78e0bc37e.tar.gz
forums-b225dd37d765cc37beccb139e63432d78e0bc37e.tar.bz2
forums-b225dd37d765cc37beccb139e63432d78e0bc37e.tar.xz
forums-b225dd37d765cc37beccb139e63432d78e0bc37e.zip
[ticket/11977] Use CSS instead of JS to disable up/down icons
PHPBB3-11977
Diffstat (limited to 'phpBB/adm/style')
-rw-r--r--phpBB/adm/style/acp_forums.html25
-rw-r--r--phpBB/adm/style/acp_groups_position.html42
-rw-r--r--phpBB/adm/style/admin.css8
-rw-r--r--phpBB/adm/style/ajax.js79
4 files changed, 20 insertions, 134 deletions
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index 3fd2f18d67..d4088a9b44 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -453,19 +453,10 @@
<!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}{L_COLON} <strong>{forums.FORUM_TOPICS}</strong> / {L_POSTS}{L_COLON} <strong>{forums.FORUM_POSTS}</strong></span><!-- ENDIF -->
</td>
<td class="actions">
- <!-- IF forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
- <span class="up">{ICON_MOVE_UP_DISABLED}</span>
- <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span>
- <!-- ELSEIF not forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
- <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span>
- <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span>
- <!-- ELSEIF forums.S_LAST_ROW && not forums.S_FIRST_ROW -->
- <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span>
- <span class="down">{ICON_MOVE_DOWN_DISABLED}</span>
- <!-- ELSE -->
- <span class="up">{ICON_MOVE_UP_DISABLED}</span>
- <span class="down">{ICON_MOVE_DOWN_DISABLED}</span>
- <!-- ENDIF -->
+ <span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span>
<a href="{forums.U_EDIT}">{ICON_EDIT}</a>
<!-- IF not forums.S_FORUM_LINK -->
<a href="{forums.U_SYNC}" onclick="popup_progress_bar();">{ICON_SYNC}</a>
@@ -501,14 +492,6 @@
</fieldset>
</form>
- <div class="hidden">
- <a class="template-up-img" href="#">{ICON_MOVE_UP}</a>
- <span class="template-up-img-disabled">{ICON_MOVE_UP_DISABLED}</span>
-
- <a class="template-down-img" href="#">{ICON_MOVE_DOWN}</a>
- <span class="template-down-img-disabled">{ICON_MOVE_DOWN_DISABLED}</span>
- </div>
-
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_groups_position.html b/phpBB/adm/style/acp_groups_position.html
index 7aa894945a..e9858b4018 100644
--- a/phpBB/adm/style/acp_groups_position.html
+++ b/phpBB/adm/style/acp_groups_position.html
@@ -42,19 +42,10 @@
<td><strong<!-- IF legend.GROUP_COLOUR --> style="color: {legend.GROUP_COLOUR}"<!-- ENDIF -->>{legend.GROUP_NAME}</strong></td>
<td style="text-align: center;">{legend.GROUP_TYPE}</td>
<td class="actions">
- <!-- IF legend.S_FIRST_ROW && not legend.S_LAST_ROW -->
- <span class="up">{ICON_MOVE_UP_DISABLED}</span>
- <span class="down"><a href="{legend.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span>
- <!-- ELSEIF not legend.S_FIRST_ROW && not legend.S_LAST_ROW -->
- <span class="up"><a href="{legend.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span>
- <span class="down"><a href="{legend.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span>
- <!-- ELSEIF legend.S_LAST_ROW && not legend.S_FIRST_ROW -->
- <span class="up"><a href="{legend.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span>
- <span class="down">{ICON_MOVE_DOWN_DISABLED}</span>
- <!-- ELSE -->
- <span class="up">{ICON_MOVE_UP_DISABLED}</span>
- <span class="down">{ICON_MOVE_DOWN_DISABLED}</span>
- <!-- ENDIF -->
+ <span class="up-disabled" style="display: none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{legend.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{legend.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span>
<a href="{legend.U_DELETE}">{ICON_DELETE}</a>
</td>
</tr>
@@ -137,19 +128,10 @@
<td style="text-align: center;"><!-- IF teampage.GROUP_TYPE -->{teampage.GROUP_TYPE}<!-- ELSE -->-<!-- ENDIF -->
</td></td>
<td class="actions">
- <!-- IF teampage.S_FIRST_ROW && not teampage.S_LAST_ROW -->
- <span class="up">{ICON_MOVE_UP_DISABLED}</span>
- <span class="down"><a href="{teampage.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span>
- <!-- ELSEIF not teampage.S_FIRST_ROW && not teampage.S_LAST_ROW -->
- <span class="up"><a href="{teampage.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span>
- <span class="down"><a href="{teampage.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span>
- <!-- ELSEIF teampage.S_LAST_ROW && not teampage.S_FIRST_ROW -->
- <span class="up"><a href="{teampage.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span>
- <span class="down">{ICON_MOVE_DOWN_DISABLED}</span>
- <!-- ELSE -->
- <span class="up">{ICON_MOVE_UP_DISABLED}</span>
- <span class="down">{ICON_MOVE_DOWN_DISABLED}</span>
- <!-- ENDIF -->
+ <span class="up-disabled" style="display: none;">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="up"><a href="{teampage.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span>
+ <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
+ <span class="down"><a href="{teampage.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span>
<a href="{teampage.U_DELETE}">{ICON_DELETE}</a>
</td>
</tr>
@@ -186,12 +168,4 @@
</fieldset>
</form>
- <div class="hidden">
- <a class="template-up-img" href="#">{ICON_MOVE_UP}</a>
- <span class="template-up-img-disabled">{ICON_MOVE_UP_DISABLED}</span>
-
- <a class="template-down-img" href="#">{ICON_MOVE_DOWN}</a>
- <span class="template-down-img-disabled">{ICON_MOVE_DOWN_DISABLED}</span>
- </div>
-
<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 0cbdc2e9f8..006cee9080 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -869,6 +869,14 @@ table td.actions {
white-space: nowrap;
}
+table tr:first-child td.actions .up, table tr:last-child td.actions .down {
+ display: none;
+}
+
+table tr:first-child td.actions .up-disabled, table tr:last-child td.actions .down-disabled {
+ display: inline !important;
+}
+
table.styles td.users, table td.mark {
text-align: center;
}
diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js
index efb0639f1b..78fcbd88fd 100644
--- a/phpBB/adm/style/ajax.js
+++ b/phpBB/adm/style/ajax.js
@@ -2,13 +2,6 @@
"use strict";
-var imgTemplates = {
- up: $('.template-up-img'),
- upDisabled: $('.template-up-img-disabled'),
- down: $('.template-down-img'),
- downDisabled: $('.template-down-img-disabled')
-};
-
/**
* The following callbacks are for reording items. row_down
* is triggered when an item is moved down, and row_up is triggered when
@@ -20,43 +13,7 @@ phpbb.addAjaxCallback('row_down', function() {
tr = el.parents('tr'),
trSwap = tr.next();
- /*
- * If the element was the first one, we have to:
- * - Add the up-link to the row we moved
- * - Remove the up-link on the next row
- */
- if (tr.is(':first-child')) {
- var upImg = imgTemplates.up.clone().attr('href', tr.attr('data-up'));
- tr.find('.up').html(upImg);
-
- phpbb.ajaxify({
- selector: tr.find('.up').children('a'),
- callback: 'row_up',
- overlay: false
- });
-
- trSwap.find('.up').html(imgTemplates.upDisabled.clone());
- }
-
tr.insertAfter(trSwap);
-
- /*
- * As well as:
- * - Remove the down-link on the moved row, if it is now the last row
- * - Add the down-link to the next row, if it was the last row
- */
- if (tr.is(':last-child')) {
- tr.find('.down').html(imgTemplates.downDisabled.clone());
-
- var downImg = imgTemplates.down.clone().attr('href', trSwap.attr('data-down'));
- trSwap.find('.down').html(downImg);
-
- phpbb.ajaxify({
- selector: trSwap.find('.down').children('a'),
- callback: 'row_down',
- overlay: false
- });
- }
});
phpbb.addAjaxCallback('row_up', function() {
@@ -64,43 +21,7 @@ phpbb.addAjaxCallback('row_up', function() {
tr = el.parents('tr'),
trSwap = tr.prev();
- /*
- * If the element was the last one, we have to:
- * - Add the down-link to the row we moved
- * - Remove the down-link on the next row
- */
- if (tr.is(':last-child')) {
- var downImg = imgTemplates.down.clone().attr('href', tr.attr('data-down'));
- tr.find('.down').html(downImg);
-
- phpbb.ajaxify({
- selector: tr.find('.down').children('a'),
- callback: 'row_down',
- overlay: false
- });
-
- trSwap.find('.down').html(imgTemplates.downDisabled.clone());
- }
-
tr.insertBefore(trSwap);
-
- /*
- * As well as:
- * - Remove the up-link on the moved row, if it is now the first row
- * - Add the up-link to the previous row, if it was the first row
- */
- if (tr.is(':first-child')) {
- tr.find('.up').html(imgTemplates.upDisabled.clone());
-
- var upImg = imgTemplates.up.clone().attr('href', trSwap.attr('data-up'));
- trSwap.find('.up').html(upImg);
-
- phpbb.ajaxify({
- selector: trSwap.find('.up').children('a'),
- callback: 'row_up',
- overlay: false
- });
- }
});
/**