diff options
author | javiexin <javiexin@gmail.com> | 2017-05-21 18:25:57 +0200 |
---|---|---|
committer | javiexin <javiexin@gmail.com> | 2017-05-21 18:25:57 +0200 |
commit | 37c48a59c318c12547c371f0d0a8bc84f5206dcf (patch) | |
tree | a45b111970e291ff871733cfe003a74e0631c441 /phpBB/assets/javascript/core.js | |
parent | 60d6667eb4c5ad8a02d67dea62bc2d5b9553f958 (diff) | |
parent | bd12504f6cf03b36821a5cea2bf77a419496dcdb (diff) | |
download | forums-37c48a59c318c12547c371f0d0a8bc84f5206dcf.tar forums-37c48a59c318c12547c371f0d0a8bc84f5206dcf.tar.gz forums-37c48a59c318c12547c371f0d0a8bc84f5206dcf.tar.bz2 forums-37c48a59c318c12547c371f0d0a8bc84f5206dcf.tar.xz forums-37c48a59c318c12547c371f0d0a8bc84f5206dcf.zip |
Merge branch 'ticket/15068' of https://github.com/javiexin/phpbb into ticket/15068
Diffstat (limited to 'phpBB/assets/javascript/core.js')
-rw-r--r-- | phpBB/assets/javascript/core.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index f7ace80705..b00da3caff 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -27,7 +27,10 @@ phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined'); */ phpbb.loadingIndicator = function() { if (!$loadingIndicator) { - $loadingIndicator = $('<div />', { id: 'loading_indicator' }); + $loadingIndicator = $('<div />', { + id: 'loading_indicator', + class: 'loading_indicator', + }); $loadingIndicator.appendTo('#page-footer'); } @@ -958,12 +961,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')); @@ -971,8 +968,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); }); }); |