Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions client/app/controllers/tableController.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['jquery', 'Handsontable', 'table_template', 'filesaver', 'alertify', 'qtip'], function ($, Handsontable, table_template, filesaver, alertify) {
define(['jquery','controllers/usabilityController', 'Handsontable', 'table_template', 'filesaver', 'alertify', 'qtip'], function ($, usabilityController, Handsontable, table_template, filesaver, alertify) {

'use strict';

Expand Down Expand Up @@ -567,11 +567,13 @@ define(['jquery', 'Handsontable', 'table_template', 'filesaver', 'alertify', 'qt
beforeChange: function (changes, source) {
return !(this.readOnly);
},
afterSetDataAtCell: function (changes, source) {
//update_width(this);
},
afterChange: function (row, column) {
//update_width(this);
afterSetDataAtCell: function (changes) {
var cellInput = changes[0][3];
if (cellInput === '') {
usabilityController.addValidationError('EMPTY_CELL');
} else if (isNaN(parseInt(cellInput))) {
usabilityController.addValidationError('INVALID_CELL');
}
}
};

Expand Down
4 changes: 4 additions & 0 deletions client/app/controllers/usabilityController.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ define(['table_template'], function (table_template) {
}

function addValidationError(err) {

if (analytics.validation_errors[err] === undefined) {
return;
}
analytics.validation_errors[err] += 1;
}

Expand Down
4 changes: 2 additions & 2 deletions client/app/data/pacesetters.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ define([], function () {
'GENERIC_TABLE_ERR',
'SERVER_ERR',
'GENERIC_SUBMISSION_ERR',
'NAN_EMPTY_CELLS',
'SEMANTIC_CELLS',
'EMPTY_CELL',
'INVALID_CELL',
'CELL_ERROR'
]
}
Expand Down