Permalink
Browse files

Call @@poll_portlet_render in the current context.

This may be the front-page instead of the Plone site root.
  • Loading branch information...
1 parent b90aa99 commit e4caafa11423e78960df6580d4a4ac14073c8850 @mauritsvanrees mauritsvanrees committed Mar 26, 2013
Showing with 10 additions and 3 deletions.
  1. +2 −1 src/collective/polls/portlet/voteportlet.pt
  2. +8 −2 src/collective/polls/static/js/collective.poll.js
@@ -5,7 +5,8 @@
<dl class="portlet votePortlet vote-container"
tal:define="poll view/poll"
- tal:attributes="data view/portlet_manager_name"
+ tal:attributes="data-manager view/portlet_manager_name;
+ data-url context/absolute_url;"
i18n:domain="collective.polls">
<dt class="portletHeader" tal:condition="view/getHeader">
@@ -129,15 +129,21 @@
//gets the portlet assigment column
var manager = ''
if ($parent[0] !== undefined){
- manager = $parent.attr('data');
+ manager = $parent.attr('data-manager');
}
if (! manager){
// Portlet reload will not work, so we refresh the page.
window.location = window.location;
}
else {
+ // Get the base for the url, which could
+ // be the url of the front-page.
+ var base = $parent.attr('data-url');
+ if (! base) {
+ base = '.';
+ }
$.ajax({
- url: './@@poll_portlet_render',
+ url: base + '/@@poll_portlet_render',
data: {'column':manager},
success:function(data){
$parent.replaceWith(data);

0 comments on commit e4caafa

Please sign in to comment.