From fb7e1ed2384c19830451ab9a421d29df8e5435d0 Mon Sep 17 00:00:00 2001 From: jpr-odoo Date: Tue, 19 Sep 2017 16:47:50 +0530 Subject: [PATCH] [FIX] payment: correctly display additional payment icons when clicking on "and more" in payment form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of being redirected to the top of the page. Which is probably not good uzabilitiouaïze. --- addons/payment/static/src/js/payment_form.js | 13 ++++++++++++- addons/payment/views/payment_templates.xml | 8 ++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/addons/payment/static/src/js/payment_form.js b/addons/payment/static/src/js/payment_form.js index 74b098c3d72..bdac673f67e 100644 --- a/addons/payment/static/src/js/payment_form.js +++ b/addons/payment/static/src/js/payment_form.js @@ -14,7 +14,8 @@ odoo.define('payment.payment_form', function (require) { 'click #o_payment_form_pay': 'payEvent', 'click #o_payment_form_add_pm': 'addPmEvent', 'click button[name="delete_pm"]': 'deletePmEvent', - 'click input[type="radio"]': 'radioClickEvent' + 'click input[type="radio"]': 'radioClickEvent', + 'click .o_payment_form_pay_icon_more': 'onClickMorePaymentIcon', }, init: function(parent, options) { @@ -337,6 +338,16 @@ odoo.define('payment.payment_form', function (require) { ); }); }, + + // event handler when clicking on 'and more' to show more payment icon + onClickMorePaymentIcon: function (ev) { + ev.preventDefault(); + var $listItems = $(ev.currentTarget).parents('ul').children('li'); + var $moreItem = $(ev.currentTarget).parents('li'); + $listItems.removeClass('hidden'); + $moreItem.addClass('hidden'); + }, + // event handler when clicking on a radio button radioClickEvent: function (ev) { this.updateNewPaymentDisplayStatus(); diff --git a/addons/payment/views/payment_templates.xml b/addons/payment/views/payment_templates.xml index 446d248680f..c601d945261 100644 --- a/addons/payment/views/payment_templates.xml +++ b/addons/payment/views/payment_templates.xml @@ -65,13 +65,13 @@