Commit 73736a63 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1710988: fix js when catching 'pagechanged' event"

parents 0b30a77a e7ed751f
......@@ -185,7 +185,7 @@ jQuery(function($) {
$(searchA.parentNode).addClass('active');
$('#artefactchooser-searchfield').on('keypress', function(e) {
if (e.key().code == 13) { // enter pressed - submitting form
if (e.keycode == 13) { // enter pressed - submitting form
e.preventDefault();
$('#artefactchooser-searchsubmit').triggerHandler('click', true);
}
......@@ -253,15 +253,15 @@ var ArtefactChooserSelect = (function($) {
/**
* Update artefact data & connect radios to the selectjscallback
*/
this.pageChanged = function(data) {
this.pageChanged = function(ev, data) {
self.artefacts = data.artefactdata;
self.connectRadios(data);
}
this.connectRadios = function(data) {
$('#{$datatable} input').on('click', function(id, radio) {
if (self.artefacts[radio.value]) {
{$element['selectjscallback']}(self.artefacts[radio.value]);
$('#{$datatable} input').on('click', function(data) {
if (self.artefacts[data.target.value]) {
{$element['selectjscallback']}(self.artefacts[data.target.value]);
}
});
}
......@@ -398,7 +398,7 @@ var ArtefactChooserData = (function($) {
/**
* When a pagination link is clicked, update the list of seen inputs
*/
this.pageChanged = function(data) {
this.pageChanged = function(ev, data) {
self.scrapeForOnpage();
if ($.inArray(data.offset, self.seenOffsets) == -1) {
self.scrapeForSelected();
......
......@@ -115,7 +115,7 @@ jQuery(function($) {
function PaginatorData() {
var self = this;
var params = {};
this.pageChanged = function(data) {
this.pageChanged = function(ev, data) {
self.params = {
'offset': data.offset,
'limit': data.limit,
......
......@@ -117,7 +117,7 @@ jQuery(function($) {
function PaginatorData() {
var self = this;
var params = {};
this.pageChanged = function(data) {
this.pageChanged = function(ev, data) {
self.params = {
'offset': data.offset,
'limit': data.limit,
......
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