[PATCH] Bug fix: Properly reload grid content

The grid reload function requires a data argument related to the grid object. It is passed to the handler in the event.data property each time an event is trigered. So, properly get the grid object on event.data property to do the reload. To test this, you can manually lock YUM/apt on system by running a system update command and then verify on Kimchi that the packages update and repositories information was not loaded. Stop the system update you have manually started and click on "Retry" button. Without this patch you will get a Javascript error: 'grid' is undefined. And with that the content will be properly reloaded. Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- ui/js/src/kimchi.grid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/js/src/kimchi.grid.js b/ui/js/src/kimchi.grid.js index eccac1c..6fed753 100644 --- a/ui/js/src/kimchi.grid.js +++ b/ui/js/src/kimchi.grid.js @@ -503,7 +503,7 @@ kimchi.widget.Grid.prototype = (function() { $('.retry-button', domNode).on('click', { grid: this }, function(event) { - grid.reload(); + event.data.grid.reload(); }); }; -- 2.1.0

Reviewed-by: Crístian Viana <vianac@linux.vnet.ibm.com> On 26-02-2015 09:05, Aline Manera wrote:
The grid reload function requires a data argument related to the grid object. It is passed to the handler in the event.data property each time an event is trigered. So, properly get the grid object on event.data property to do the reload.
To test this, you can manually lock YUM/apt on system by running a system update command and then verify on Kimchi that the packages update and repositories information was not loaded. Stop the system update you have manually started and click on "Retry" button. Without this patch you will get a Javascript error:
'grid' is undefined.
And with that the content will be properly reloaded.
Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com>
participants (2)
-
Aline Manera
-
Crístian Viana