diff options
| author | Vjacheslav Trushkin <cyberalien@gmail.com> | 2013-10-26 20:28:36 +0300 |
|---|---|---|
| committer | Vjacheslav Trushkin <cyberalien@gmail.com> | 2013-10-26 20:28:36 +0300 |
| commit | e8b4a50a3d17e812995828e1b274a2b6930389f6 (patch) | |
| tree | 488d76d25381dffdd3e4812b80e425fd69ec7236 | |
| parent | c521380273be66ed99e2f16ba914a033a6bf3250 (diff) | |
| download | forums-e8b4a50a3d17e812995828e1b274a2b6930389f6.tar forums-e8b4a50a3d17e812995828e1b274a2b6930389f6.tar.gz forums-e8b4a50a3d17e812995828e1b274a2b6930389f6.tar.bz2 forums-e8b4a50a3d17e812995828e1b274a2b6930389f6.tar.xz forums-e8b4a50a3d17e812995828e1b274a2b6930389f6.zip | |
[ticket/11956] Ability to swap full and responsive text
PHPBB3-11956
| -rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index a01e7fd405..1b2b1954ef 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -924,6 +924,31 @@ function parse_document(container) $(this).addClass('responsive-hide'); } }); + + /** + * Replace responsive text + */ + container.find('[data-responsive-text]').each(function() { + var $this = $(this), + fullText = $this.text(), + responsiveText = $this.attr('data-responsive-text'), + responsive = false; + + function check() { + if ($(window).width() > 700) { + if (!responsive) return; + $this.text(fullText); + responsive = false; + return; + } + if (responsive) return; + $this.text(responsiveText); + responsive = true; + } + + check(); + $(window).resize(check); + }); } /** |
