[ticket/12769] Fix subscription toggling fn

This commit is contained in:
Michael Miday 2015-09-15 23:31:14 +02:00
parent fd72a36a0c
commit ea591562ae

View file

@ -957,12 +957,6 @@ phpbb.addAjaxCallback('toggle_link', function() {
$anchor.each(function() {
var $this = $(this);
// Toggle link text
toggleText = $this.attr('data-toggle-text');
$this.attr('data-toggle-text', $this.text());
$this.attr('title', $.trim(toggleText));
$this.text(toggleText);
// Toggle link url
toggleUrl = $this.attr('data-toggle-url');
$this.attr('data-toggle-url', $this.attr('href'));
@ -970,8 +964,14 @@ phpbb.addAjaxCallback('toggle_link', function() {
// Toggle class of link parent
toggleClass = $this.attr('data-toggle-class');
$this.attr('data-toggle-class', $this.parent().attr('class'));
$this.parent().attr('class', toggleClass);
$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);
});
});