mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 05:18:52 +00:00
[ticket/16237] fix ajax subscribe icons
PHPBB3-16237
This commit is contained in:
parent
dc4fe2d4b7
commit
8f4b546958
7 changed files with 61 additions and 35 deletions
|
@ -1052,11 +1052,11 @@ phpbb.addAjaxCallback('alt_text', function() {
|
||||||
* and changes the link itself.
|
* and changes the link itself.
|
||||||
*/
|
*/
|
||||||
phpbb.addAjaxCallback('toggle_link', function() {
|
phpbb.addAjaxCallback('toggle_link', function() {
|
||||||
var $anchor,
|
let $anchor;
|
||||||
updateAll = $(this).data('update-all') ,
|
let updateAll = $(this).data('update-all');
|
||||||
toggleText,
|
let toggleText;
|
||||||
toggleUrl,
|
let toggleUrl;
|
||||||
toggleClass;
|
let toggleIcon;
|
||||||
|
|
||||||
if (updateAll !== undefined && updateAll.length) {
|
if (updateAll !== undefined && updateAll.length) {
|
||||||
$anchor = $(updateAll);
|
$anchor = $(updateAll);
|
||||||
|
@ -1067,21 +1067,19 @@ phpbb.addAjaxCallback('toggle_link', function() {
|
||||||
$anchor.each(function() {
|
$anchor.each(function() {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
|
||||||
|
// Toggle link text
|
||||||
|
toggleText = $.trim($this.attr('data-toggle-text'));
|
||||||
|
$this.attr('data-toggle-text', $.trim($this.children('span').text()));
|
||||||
|
$this.attr('title', toggleText);
|
||||||
|
$this.children('span').last().text(toggleText);
|
||||||
|
|
||||||
// Toggle link url
|
// Toggle link url
|
||||||
toggleUrl = $this.attr('data-toggle-url');
|
toggleUrl = $this.attr('data-toggle-url');
|
||||||
$this.attr('data-toggle-url', $this.attr('href'));
|
$this.attr('data-toggle-url', $this.attr('href'));
|
||||||
$this.attr('href', toggleUrl);
|
$this.attr('href', toggleUrl);
|
||||||
|
|
||||||
// Toggle class of link parent
|
// Toggle Icon
|
||||||
toggleClass = $this.attr('data-toggle-class');
|
$this.children().first().toggleClass('is-active').next().toggleClass('is-active')
|
||||||
$this.attr('data-toggle-class', $this.children().attr('class'));
|
|
||||||
$this.children('.icon').attr('class', toggleClass);
|
|
||||||
|
|
||||||
// Toggle link text
|
|
||||||
toggleText = $this.attr('data-toggle-text');
|
|
||||||
$this.attr('data-toggle-text', $this.children('span').text());
|
|
||||||
$this.attr('title', $.trim(toggleText));
|
|
||||||
$this.children('span').text(toggleText);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,6 @@
|
||||||
<!-- ELSEIF forumrow.U_UNAPPROVED_POSTS -->
|
<!-- ELSEIF forumrow.U_UNAPPROVED_POSTS -->
|
||||||
<a href="{forumrow.U_UNAPPROVED_POSTS}" title="{L_POSTS_UNAPPROVED_FORUM}">
|
<a href="{forumrow.U_UNAPPROVED_POSTS}" title="{L_POSTS_UNAPPROVED_FORUM}">
|
||||||
{{ Icon('iconify', 'mdi:alert-decagram', '', true, 'c-unapproved-icon') }}<span class="sr-only">{L_TOPICS_UNAPPROVED}</span>
|
{{ Icon('iconify', 'mdi:alert-decagram', '', true, 'c-unapproved-icon') }}<span class="sr-only">{L_TOPICS_UNAPPROVED}</span>
|
||||||
<span class="sr-only">{L_POSTS_UNAPPROVED_FORUM}</span>
|
|
||||||
</a>
|
</a>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- IF forumrow.LAST_POST_TIME -->
|
<!-- IF forumrow.LAST_POST_TIME -->
|
||||||
|
@ -116,7 +115,6 @@
|
||||||
<!-- IF not S_IS_BOT -->
|
<!-- IF not S_IS_BOT -->
|
||||||
<a href="{forumrow.U_LAST_POST}" title="{L_VIEW_LATEST_POST}">
|
<a href="{forumrow.U_LAST_POST}" title="{L_VIEW_LATEST_POST}">
|
||||||
{{ Icon('iconify', 'fa:external-link-square', '', true, 'c-last-post-icon') }}<span class="sr-only">{L_TOPICS_UNAPPROVED}</span>
|
{{ Icon('iconify', 'fa:external-link-square', '', true, 'c-last-post-icon') }}<span class="sr-only">{L_TOPICS_UNAPPROVED}</span>
|
||||||
<span class="sr-only">{L_VIEW_LATEST_POST}</span>
|
|
||||||
</a>
|
</a>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<br /><time datetime="{forumrow.LAST_POST_TIME_RFC3339}">{forumrow.LAST_POST_TIME}</time>
|
<br /><time datetime="{forumrow.LAST_POST_TIME_RFC3339}">{forumrow.LAST_POST_TIME}</time>
|
||||||
|
|
|
@ -24,11 +24,15 @@
|
||||||
</li>
|
</li>
|
||||||
<!-- IF U_WATCH_FORUM_LINK and not S_IS_BOT -->
|
<!-- IF U_WATCH_FORUM_LINK and not S_IS_BOT -->
|
||||||
<li data-last-responsive="true">
|
<li data-last-responsive="true">
|
||||||
<a class="c-subscribe-action{% if not S_WATCHING_FORUM %} is-active {% endif %}" href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-swap="subscribe" data-swap-url="{U_WATCH_FORUM_TOGGLE}">
|
<a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">
|
||||||
{{ Icon('iconify', 'mdi:checkbox-blank-outline', '', true, 'c-subscibe-icon') }}<span>{S_WATCH_FORUM_TITLE}</span>
|
{% if S_WATCHING_FORUM %}
|
||||||
</a>
|
{{ Icon('iconify', 'mdi:checkbox-blank-outline', '', true, 'c-subscribe-icon') }}
|
||||||
<a class="c-subscribe-action{% if S_WATCHING_FORUM %} is-active {% endif %}" href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-swap="subscribe" data-swap-url="{U_WATCH_FORUM_TOGGLE}">
|
{{ Icon('iconify', 'mdi:checkbox-marked', '', true, 'c-subscribe-icon is-active') }}
|
||||||
{{ Icon('iconify', 'mdi:checkbox-marked', '', true, 'c-subscibe-icon') }}<span>{S_WATCH_FORUM_TITLE}</span>
|
{% else %}
|
||||||
|
{{ Icon('iconify', 'mdi:checkbox-blank-outline', '', true, 'c-subscribe-icon is-active') }}
|
||||||
|
{{ Icon('iconify', 'mdi:checkbox-marked', '', true, 'c-subscribe-icon') }}
|
||||||
|
{% endif %}
|
||||||
|
<span>{S_WATCH_FORUM_TITLE}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
|
@ -10,11 +10,15 @@
|
||||||
<!-- EVENT viewtopic_topic_tools_before -->
|
<!-- EVENT viewtopic_topic_tools_before -->
|
||||||
<!-- IF U_WATCH_TOPIC -->
|
<!-- IF U_WATCH_TOPIC -->
|
||||||
<li>
|
<li>
|
||||||
<a class="c-subscribe-action{% if not S_WATCHING_TOPIC %} is-active {% endif %}" href="{U_WATCH_TOPIC}" title="{S_WATCH_TOPIC_TITLE}" data-ajax="swap_subscribe" data-swap="subscribe" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}" data-update-all=".c-cubscribe-action">
|
<a href="{U_WATCH_TOPIC}" class="watch-topic-link" title="{S_WATCH_TOPIC_TITLE}" data-ajax="toggle_link" data-toggle-text="{S_WATCH_TOPIC_TOGGLE}" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}" data-update-all=".watch-topic-link">
|
||||||
{{ Icon('iconify', 'mdi:checkbox-blank-outline', '', true, 'c-subscibe-icon') }}<span>{S_WATCH_TOPIC_TITLE}</span>
|
{% if S_WATCHING_TOPIC %}
|
||||||
</a>
|
{{ Icon('iconify', 'mdi:checkbox-blank-outline', '', true, 'c-subscribe-icon') }}
|
||||||
<a class="c-subscribe-action{% if S_WATCHING_TOPIC %} is-active {% endif %}" href="{U_WATCH_TOPIC}" title="{S_WATCH_TOPIC_TITLE}" data-ajax="swap_subscribe" data-swap="subscribe" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}" data-update-all=".c-cubscribe-action">
|
{{ Icon('iconify', 'mdi:checkbox-marked', '', true, 'c-subscribe-icon is-active') }}
|
||||||
{{ Icon('iconify', 'mdi:checkbox-marked', '', true, 'c-subscibe-icon') }}<span>{S_WATCH_TOPIC_TITLE}</span>
|
{% else %}
|
||||||
|
{{ Icon('iconify', 'mdi:checkbox-blank-outline', '', true, 'c-subscribe-icon is-active') }}
|
||||||
|
{{ Icon('iconify', 'mdi:checkbox-marked', '', true, 'c-subscribe-icon') }}
|
||||||
|
{% endif %}
|
||||||
|
<span>{S_WATCH_TOPIC_TITLE}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
|
@ -280,6 +280,17 @@ a.rightside {
|
||||||
margin-left: 7px;
|
margin-left: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul.linklist li a:hover,
|
||||||
|
ul.linklist li a:focus,
|
||||||
|
ul.linklist li a:active {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.linklist li a:hover span,
|
||||||
|
ul.linklist li a:focus span {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
ul.navlinks {
|
ul.navlinks {
|
||||||
border-top: 1px solid transparent;
|
border-top: 1px solid transparent;
|
||||||
}
|
}
|
||||||
|
@ -496,6 +507,17 @@ a.header-avatar img {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-contents a:hover,
|
||||||
|
.dropdown-contents a:active,
|
||||||
|
.dropdown-contents a:focus {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-contents a:hover span,
|
||||||
|
.dropdown-contents a:focus span {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
.jumpbox {
|
.jumpbox {
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,3 +120,11 @@ blockquote cite:before,
|
||||||
.c-button-icon {
|
.c-button-icon {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.c-subscribe-icon {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.c-subscribe-icon.is-active {
|
||||||
|
display: inline !important;
|
||||||
|
}
|
||||||
|
|
|
@ -204,11 +204,3 @@ a.feed-icon-forum {
|
||||||
a.anchor {
|
a.anchor {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.c-subscribe-action {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.c-subscribe-action.is-active {
|
|
||||||
display: inline-block !important;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue