mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11956] Ability to swap full and responsive text
PHPBB3-11956
This commit is contained in:
parent
c521380273
commit
e8b4a50a3d
1 changed files with 25 additions and 0 deletions
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue