aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2013-10-07 17:55:04 -0700
committerCesar G <prototech91@gmail.com>2013-10-07 17:55:04 -0700
commit98a1694c7c1022d50c30b7dcd46f9f0fc9f5f7b4 (patch)
treebbff2c273535d598a99bdc32dd24eeeb4a1a5217
parent7f312772699c10339a8c50ef7952179da40ef7e7 (diff)
downloadforums-98a1694c7c1022d50c30b7dcd46f9f0fc9f5f7b4.tar
forums-98a1694c7c1022d50c30b7dcd46f9f0fc9f5f7b4.tar.gz
forums-98a1694c7c1022d50c30b7dcd46f9f0fc9f5f7b4.tar.bz2
forums-98a1694c7c1022d50c30b7dcd46f9f0fc9f5f7b4.tar.xz
forums-98a1694c7c1022d50c30b7dcd46f9f0fc9f5f7b4.zip
[ticket/10383] Update the results without the overlay popup.
PHPBB3-10383
-rw-r--r--phpBB/styles/prosilver/template/ajax.js33
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html3
-rw-r--r--phpBB/styles/prosilver/theme/content.css6
-rw-r--r--phpBB/viewtopic.php2
4 files changed, 38 insertions, 6 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index 39beab4f16..28656d47d3 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -166,8 +166,12 @@ phpbb.addAjaxCallback('vote_poll', function(res) {
var panel = poll.find('.panel');
var results_visible = poll.find('dl:first-child .resultbar').is(':visible');
- // Force the current height to prevent the page from jumping when the content changes
- panel.height(panel.find('.inner').outerHeight());
+ // Set min-height to prevent the page from jumping when the content changes
+ var update_panel_height = function (height) {
+ var height = (typeof height === 'undefined') ? panel.find('.inner').outerHeight() : height;
+ panel.css('min-height', height);
+ };
+ update_panel_height();
// Remove the View results link
if (!results_visible) {
@@ -213,10 +217,33 @@ phpbb.addAjaxCallback('vote_poll', function(res) {
poll.find('.polls').delay(400).fadeIn(500);
}
+ // Display "Your vote has been cast." message. Disappears after 5 seconds.
+ var confirmation_delay = (res.can_vote) ? 300 : 900;
+ poll.find('.vote-submitted').delay(confirmation_delay).slideDown(200, function() {
+ if (results_visible) {
+ update_panel_height();
+ }
+
+ $(this).delay(5000).fadeOut(500, function() {
+ resize_panel(300);
+ });
+ });
+
// Remove the gap resulting from removing options
setTimeout(function() {
- panel.animate({height: panel.find('.inner').height()}, 500);
+ resize_panel(500);
}, 1500);
+
+ var resize_panel = function (time) {
+ var panel_height = panel.height();
+ var inner_height = panel.find('.inner').outerHeight();
+
+ if (panel_height != inner_height) {
+ panel.css({'min-height': '', 'height': panel_height}).animate({height: inner_height}, time, function () {
+ panel.css({'min-height': inner_height, 'height': ''});
+ });
+ }
+ };
}
});
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 61077fd0c4..e678ea8f8c 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -60,7 +60,7 @@
<div class="clear"></div>
<!-- IF S_HAS_POLL -->
- <form method="post" action="{S_POLL_ACTION}" data-ajax="vote_poll" class="topic_poll">
+ <form method="post" action="{S_POLL_ACTION}" data-ajax="vote_poll" data-overlay="false" class="topic_poll">
<div class="panel">
<div class="inner">
@@ -98,6 +98,7 @@
</dl>
<!-- ENDIF -->
</fieldset>
+ <div class="vote-submitted hidden">{L_VOTE_SUBMITTED}</div>
</div>
</div>
diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css
index c56c7f9ef8..60475aea7d 100644
--- a/phpBB/styles/prosilver/theme/content.css
+++ b/phpBB/styles/prosilver/theme/content.css
@@ -662,6 +662,12 @@ fieldset.polls dd div {
border-right: 1px solid transparent;
}
+.vote-submitted {
+ font-size: 1.2em;
+ font-weight: bold;
+ text-align: center;
+}
+
/* Poster profile block
----------------------------------------*/
.postprofile {
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 43bf3a27c6..3a7e633c99 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -835,8 +835,6 @@ if (!empty($topic_data['poll_start']))
$valid_user_votes = array_intersect(array_keys($vote_counts), $voted_id);
$data = array(
- 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
- 'MESSAGE_TEXT' => $message,
'NO_VOTES' => $user->lang['NO_VOTES'],
'success' => true,
'user_votes' => array_flip($valid_user_votes),