(options)
| 490 | } |
| 491 | |
| 492 | function LinkCell(options) { |
| 493 | return _.defaults(options, { |
| 494 | title: options.title |
| 495 | , defaultOrder: 'asc' |
| 496 | , build: function() { |
| 497 | var td = document.createElement('td') |
| 498 | var a = document.createElement('a') |
| 499 | a.appendChild(document.createTextNode('')) |
| 500 | td.appendChild(a) |
| 501 | return td |
| 502 | } |
| 503 | , update: function(td, item) { |
| 504 | var a = td.firstChild |
| 505 | var t = a.firstChild |
| 506 | var href = options.link(item) |
| 507 | if (href) { |
| 508 | a.setAttribute('href', href) |
| 509 | } |
| 510 | else { |
| 511 | a.removeAttribute('href') |
| 512 | } |
| 513 | a.target = options.target || '' |
| 514 | t.nodeValue = options.value(item) |
| 515 | return td |
| 516 | } |
| 517 | , compare: function(a, b) { |
| 518 | return compareIgnoreCase(options.value(a), options.value(b)) |
| 519 | } |
| 520 | , filter: function(item, filter) { |
| 521 | return filterIgnoreCase(options.value(item), filter.query) |
| 522 | } |
| 523 | }) |
| 524 | } |
| 525 | |
| 526 | function DeviceBrowserCell(options) { |
| 527 | return _.defaults(options, { |
no test coverage detected