Commit 4dbbeb19 by Ivan Ivic

[SOL-1856] User is taken back to coupons home on clicking next button from courses table.

parent f4273235
...@@ -92,6 +92,23 @@ define([ ...@@ -92,6 +92,23 @@ define([
{title: 'Seat type', data: 'type'} {title: 'Seat type', data: 'type'}
]); ]);
}); });
it('should call stopEventPropagation when disabled or active button pressed', function () {
var e = $.Event('click');
view.$el.append('<div class="pagination">' +
'<li class="paginate_button previous disabled">' +
'<a href="#">Previous</a>' +
'</li></div>');
spyOn(e, 'stopPropagation');
view.stopEventPropagation(e);
expect(e.stopPropagation).toHaveBeenCalled();
spyOn(view, 'stopEventPropagation');
view.delegateEvents();
view.$('.pagination .disabled').trigger('click');
expect(view.stopEventPropagation).toHaveBeenCalled();
});
}); });
} }
); );
...@@ -15,7 +15,8 @@ define(['jquery', ...@@ -15,7 +15,8 @@ define(['jquery',
template: _.template(DynamicCatalogButtons), template: _.template(DynamicCatalogButtons),
events: { events: {
'click [name=preview_catalog]': 'previewCatalog' 'click [name=preview_catalog]': 'previewCatalog',
'click .pagination .disabled, .pagination .active': 'stopEventPropagation'
}, },
initialize: function (options) { initialize: function (options) {
...@@ -24,6 +25,10 @@ define(['jquery', ...@@ -24,6 +25,10 @@ define(['jquery',
this._super(); this._super();
}, },
stopEventPropagation: function(event) {
event.stopPropagation();
},
getRowData: function (course) { getRowData: function (course) {
return { return {
id: course.id, id: course.id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment