Skip to content

Commit

Permalink
fix null handling
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipRieck committed Aug 19, 2016
1 parent 77cf1ab commit 1a810b2
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 25 deletions.
2 changes: 1 addition & 1 deletion dist/amd/au-table-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ define(["exports", "aurelia-framework"], function (exports, _aureliaFramework) {

var _dec, _desc, _value, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4;

var AutPaginationCustomElement = exports.AutPaginationCustomElement = (_dec = (0, _aureliaFramework.bindable)({defaultBindingMode: _aureliaFramework.bindingMode.twoWay}), (_class = function () {
var AutPaginationCustomElement = exports.AutPaginationCustomElement = (_dec = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), (_class = function () {
function AutPaginationCustomElement() {
_classCallCheck(this, AutPaginationCustomElement);

Expand Down
11 changes: 7 additions & 4 deletions dist/amd/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,14 @@ define(["exports", "aurelia-framework"], function (exports, _aureliaFramework) {

var key = _ref2;

var value = next[key].toString();

if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
if (next[key]) {
var value = next[key].toString().toLowerCase();

if (value.indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/au-table-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function _initializerWarningHelper(descriptor, context) {
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
}

var AutPaginationCustomElement = exports.AutPaginationCustomElement = (_dec = (0, _aureliaFramework.bindable)({defaultBindingMode: _aureliaFramework.bindingMode.twoWay}), (_class = function () {
var AutPaginationCustomElement = exports.AutPaginationCustomElement = (_dec = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), (_class = function () {
function AutPaginationCustomElement() {
_classCallCheck(this, AutPaginationCustomElement);

Expand Down
11 changes: 7 additions & 4 deletions dist/commonjs/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,14 @@ var AureliaTableCustomAttribute = exports.AureliaTableCustomAttribute = (_dec =

var key = _ref2;

var value = next[key].toString();

if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
if (next[key]) {
var value = next[key].toString().toLowerCase();

if (value.indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/au-table-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function _initializerWarningHelper(descriptor, context) {

import { bindable, bindingMode } from "aurelia-framework";

export let AutPaginationCustomElement = (_dec = bindable({defaultBindingMode: bindingMode.twoWay}), (_class = class AutPaginationCustomElement {
export let AutPaginationCustomElement = (_dec = bindable({ defaultBindingMode: bindingMode.twoWay }), (_class = class AutPaginationCustomElement {
constructor() {
_initDefineProp(this, "currentPage", _descriptor, this);

Expand Down
11 changes: 7 additions & 4 deletions dist/es2015/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,14 @@ export let AureliaTableCustomAttribute = (_dec = inject(BindingEngine), _dec2 =

for (let next of toFilter) {
for (let key of this.filterKeys) {
let value = next[key].toString();

if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
if (next[key]) {
let value = next[key].toString().toLowerCase();

if (value.indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/system/au-table-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ System.register(["aurelia-framework"], function (_export, _context) {
bindingMode = _aureliaFramework.bindingMode;
}],
execute: function () {
_export("AutPaginationCustomElement", AutPaginationCustomElement = (_dec = bindable({defaultBindingMode: bindingMode.twoWay}), (_class = function () {
_export("AutPaginationCustomElement", AutPaginationCustomElement = (_dec = bindable({ defaultBindingMode: bindingMode.twoWay }), (_class = function () {
function AutPaginationCustomElement() {
_classCallCheck(this, AutPaginationCustomElement);

Expand Down
11 changes: 7 additions & 4 deletions dist/system/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,14 @@ System.register(["aurelia-framework"], function (_export, _context) {

var key = _ref2;

var value = next[key].toString();

if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
if (next[key]) {
var value = next[key].toString().toLowerCase();

if (value.indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
}
}
}
}
Expand Down
13 changes: 8 additions & 5 deletions src/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,17 @@ export class AureliaTableCustomAttribute {

doFilter(toFilter) {
let filteredData = [];

for (let next of toFilter) {
for (let key of this.filterKeys) {
let value = next[key].toString();

if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
if( next[key]){
let value = next[key].toString().toLowerCase();

if (value.indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
}
}
}
}
Expand Down

0 comments on commit 1a810b2

Please sign in to comment.