Browse Source

Fixed #531: a bug in the `DataSet` returning an empty object instead of `null` when no item was found when using both a filter and specifying fields.

v3_develop
jos 9 years ago
parent
commit
b778649725
6 changed files with 23642 additions and 23589 deletions
  1. +3
    -1
      HISTORY.md
  2. +23616
    -23569
      dist/vis.js
  3. +1
    -1
      dist/vis.map
  4. +1
    -1
      dist/vis.min.css
  5. +15
    -15
      dist/vis.min.js
  6. +6
    -2
      lib/DataSet.js

+ 3
- 1
HISTORY.md View File

@ -9,11 +9,13 @@ http://visjs.org
- Added option bindToWindow (default true) to choose whether the keyboard binds are global or to the network div.
- Improved images handling so broken images are shown on all references of images that are broken.
### DataSet
### DataSet/DataView
- Added property `length` holding the total number of items to the `DataSet`
and `DataView`.
- Added a method `refresh()` to the `DataView`, to update filter results.
- Fixed a bug in the `DataSet` returning an empty object instead of `null` when
no item was found when using both a filter and specifying fields.
### Timeline

+ 23616
- 23569
dist/vis.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/vis.map
File diff suppressed because it is too large
View File


+ 1
- 1
dist/vis.min.css
File diff suppressed because it is too large
View File


+ 15
- 15
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 6
- 2
lib/DataSet.js View File

@ -651,12 +651,16 @@ DataSet.prototype.map = function (callback, options) {
/**
* Filter the fields of an item
* @param {Object} item
* @param {Object | null} item
* @param {String[]} fields Field names
* @return {Object} filteredItem
* @return {Object | null} filteredItem or null if no item is provided
* @private
*/
DataSet.prototype._filterFields = function (item, fields) {
if (!item) { // item is null
return item;
}
var filteredItem = {};
for (var field in item) {

Loading…
Cancel
Save