1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

#647 - Tweak forum JS with poll plugin

Hide JS when poll is not active in forums
This commit is contained in:
Tijn Kuyper
2019-10-02 12:54:53 +02:00
parent 2ea454d2b9
commit c2965627b2

View File

@@ -2,14 +2,26 @@
if (!defined('e107_INIT')) { exit; }
// Moc - temporary solution until a global/common clone method is created which replaces duplicateHTML()
e107::js("footer-inline", "
// #647 - temporary solution until a global/common clone method is created which replaces duplicateHTML()
if(!e107::isInstalled('poll'))
{
return;
}
if(e107::getPlugPref('forum', 'poll') != '255')
{
$poll_active = true;
}
if(e_CURRENT_PLUGIN == "forum" && e107::isInstalled('poll') && $poll_active)
{
e107::js("footer-inline", "
$('#addoption').click(function () {
$('#poll_answer').clone().appendTo('#pollsection').find('input[type=text]').val('');
});
");
}
$('#addoption').click(function () {
$('#poll_answer').clone().appendTo('#pollsection').find('input[type=text]').val('');
});
");
?>