aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Miday <midaym@gmail.com>2015-09-15 23:31:14 +0200
committerMichael Miday <midaym@gmail.com>2015-09-17 18:37:29 +0200
commitea591562ae4234633a99865b9539fc5b902dbe69 (patch)
tree4f4ace1acbc445c37c6d257c21d07a87f6b7c6ec
parentfd72a36a0cb063934ee2c22c66044d1e5b4e9007 (diff)
downloadforums-ea591562ae4234633a99865b9539fc5b902dbe69.tar
forums-ea591562ae4234633a99865b9539fc5b902dbe69.tar.gz
forums-ea591562ae4234633a99865b9539fc5b902dbe69.tar.bz2
forums-ea591562ae4234633a99865b9539fc5b902dbe69.tar.xz
forums-ea591562ae4234633a99865b9539fc5b902dbe69.zip
[ticket/12769] Fix subscription toggling fn
-rw-r--r--phpBB/assets/javascript/core.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 6285a16734..6a008ba1ec 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -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);
});
});