##// END OF EJS Templates
tweak documentation for viewlists
Jason Grout -
Show More
@@ -594,13 +594,14 b' define(["widgets/js/manager",'
594
594
595 var ViewList = function(create_view, remove_view, context) {
595 var ViewList = function(create_view, remove_view, context) {
596 // * create_view and remove_view are default functions called when adding or removing views
596 // * create_view and remove_view are default functions called when adding or removing views
597 // * create_view takes a model and creates a view or a promise for a view for that model
597 // * create_view takes a model and returns a view or a promise for a view for that model
598 // * remove_view takes a view and destroys it (including calling `.remove()`)
598 // * remove_view takes a view and destroys it (including calling `view.remove()`)
599 // * each time the update() function is called with a new list, the create and destroy
599 // * each time the update() function is called with a new list, the create and remove
600 // callbacks will be called in an order so that if you append the views created in the
600 // callbacks will be called in an order so that if you append the views created in the
601 // create callback, you will duplicate the order of the list.
601 // create callback and remove the views in the remove callback, you will duplicate
602 // * the remove callback defaults to just removing the view (if you pass in null)
602 // the order of the list.
603 // * the context defaults to the ViewList. If you pass another context, the create and remove
603 // * the remove callback defaults to just removing the view (e.g., pass in null for the second parameter)
604 // * the context defaults to the created ViewList. If you pass another context, the create and remove
604 // will be called in that context.
605 // will be called in that context.
605
606
606 this.initialize.apply(this, arguments);
607 this.initialize.apply(this, arguments);
@@ -653,7 +654,7 b' define(["widgets/js/manager",'
653 },
654 },
654
655
655 remove: function() {
656 remove: function() {
656 // removes every view in our list; convenience function for `.update([])`
657 // removes every view in the list; convenience function for `.update([])`
657 // that should be faster
658 // that should be faster
658 // returns a promise that resolves after this removal is done
659 // returns a promise that resolves after this removal is done
659 var that = this;
660 var that = this;
General Comments 0
You need to be logged in to leave comments. Login now