generated from OpenSourcePolitics/decidim-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: JS incompatibility between budgets-category & budget-booth (#540)
* fix: Add JS compatibility * fix: Override budgets booth update_budget.js * fix: Merge budget category & budget booth * chore: Change PTP's module branch
- Loading branch information
1 parent
3f84e32
commit 7be6655
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
var $orderTotalBudget = $('#order-total-budget'); | ||
var $orderSelectedProjects = $('#order-selected-projects'); | ||
var $orderProgress = $('#order-progress'); | ||
var $projectItem = $('#project-<%= project.id %>-item'); | ||
var $projectBudgetButton = $('#project-<%= project.id %>-budget-button'); | ||
var $budgetConfirm = $('#budget-confirm'); | ||
var $projectModal = $('#project-modal-<%= project.id %>'); | ||
|
||
morphdom($orderTotalBudget[0], '<%= j(render partial: "decidim/budgets/projects/order_total_budget").strip.html_safe %>'); | ||
morphdom($orderSelectedProjects[0], '<%= j(render partial: "decidim/budgets/projects/order_selected_projects").strip.html_safe %>'); | ||
morphdom($orderProgress[0], '<%= j(render partial: "decidim/budgets/projects/order_progress").strip.html_safe %>'); | ||
morphdom($budgetConfirm[0], '<%= j(render partial: "decidim/budgets/projects/budget_confirm").strip.html_safe %>'); | ||
|
||
<% current_order.categories.each do |category| %> | ||
var $votingSummary = $(`.vote_by_category[data-category-id=<%= category.id %>]`); | ||
morphdom($votingSummary[0], '<%= j(cell(category.card_class, category)).strip.html_safe %>'); | ||
<% end %> | ||
|
||
$("#order-progress").foundation(); | ||
$(".budget-summary__selected").foundation(); | ||
|
||
if ($projectItem.length > 0) { | ||
morphdom($projectItem[0], '<%= j(render partial: "decidim/budgets/projects/project", locals: { project: project }).strip.html_safe %>'); | ||
} | ||
|
||
if ($projectBudgetButton.length > 0) { | ||
morphdom($projectBudgetButton[0], '<%= j(render partial: "decidim/budgets/projects/project_budget_button", locals: { project: project }).strip.html_safe %>'); | ||
} | ||
|
||
if ($projectModal.length > 0) { | ||
var $projectModalButtonForm = $(".project-vote-button", $projectModal).parent(); | ||
morphdom($projectModalButtonForm[0], '<%= j(cell("decidim/budgets/project_vote_button", project, scale_up: true)).strip.html_safe %>'); | ||
} | ||
|
||
if ($projectModal.length > 0 && $projectModal.attr("aria-hidden") === "false") { | ||
$(".project-vote-button", $projectModal).focus(); | ||
} else { | ||
$(".project-vote-button", $projectItem).focus(); | ||
} | ||
|
||
<% if @show_help_modal %> | ||
$("#voting-help").foundation("open"); | ||
<% end %> | ||
|
||
window.DecidimBudgets.checkProgressPosition(); |