[ticket/11956] Ability to swap full and responsive text

PHPBB3-11956
This commit is contained in:
Vjacheslav Trushkin 2013-10-26 20:28:36 +03:00
parent c521380273
commit e8b4a50a3d

View file

@ -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);
});
}
/**