storkCore

Check-in [d4aa32cbfb]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added method for emptying a list
Timelines: family | ancestors | emptySublist
Files: files | file ages | folders
SHA1:d4aa32cbfbd19418dab773b35573acc0df86e173
User & Date: setok 2018-05-07 09:00:52
Context
2018-05-07
09:00
Added method for emptying a list Leaf check-in: d4aa32cbfb user: setok tags: emptySublist
2018-02-13
15:22
Cleaner implementation for the empty sublist check for listoflists check-in: da040a306b user: setok tags: emptySublist
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to list.js.

1091
1092
1093
1094
1095
1096
1097











1098
1099
1100
1101
1102
1103
1104
    for (var i=0; i < this.listeners.length; i++) {
        if(this.listeners[i][eventName] &&
           typeof this.listeners[i][eventName] === 'function') {
            this.listeners[i][eventName].apply(this.listeners[i], args);
        }
    }
};












/**
 * Build the model for this list from an array of objects.
 * Each object in the array becomes a StorkModel with the properties of
 * the object as model properties.
 *
 * 'items'  - An array of objects.







>
>
>
>
>
>
>
>
>
>
>







1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
    for (var i=0; i < this.listeners.length; i++) {
        if(this.listeners[i][eventName] &&
           typeof this.listeners[i][eventName] === 'function') {
            this.listeners[i][eventName].apply(this.listeners[i], args);
        }
    }
};


/**
 * Empty the list.
 */

ListModel.empty = function() {
    this.items = [];
    this.informListeners("resetEvent", [this]);
};


/**
 * Build the model for this list from an array of objects.
 * Each object in the array becomes a StorkModel with the properties of
 * the object as model properties.
 *
 * 'items'  - An array of objects.