/**
 * Collection of draft documents created by the user.
 */
var DraftsCollection = Backbone.Collection.extend({
	model: DraftsModel,
	url: '/intranet/rest/documents/folder/0/documents/?draft=1',
	is_loaded: false,

	load: function ()
	{
		this.is_loaded = true;
		this.fetch({reset: 1});
	},

	isCheckedOut: function (doc_id)
	{
		var res = this.find(function (co) { return co.get('doc_id') == doc_id; } );
		return res ? true : false;
	}

});
