Sha256: 973ff8f8ff1e500c629fc2665565c9e291072480f690926d80c307d0b86d57b9
Contents?: true
Size: 1.32 KB
Versions: 58
Compression:
Stored size: 1.32 KB
Contents
/** * pageflow.Failure and subclasses are used in the failures api. * * Subclasses that represent failures that are can not be retried should * override `catRetry` with false. * Retryable failures should implement `retryAction`. * * @class * @memberof module:pageflow/editor */ pageflow.Failure = pageflow.Object.extend({ canRetry: true, type: 'Failure', initialize: function(model) { this.model = model; }, retry: function() { if (this.canRetry) { return this.retryAction(); } }, retryAction: function() { return this.model.save(); }, key: function() { return this.model.cid + '-' + this.type; } }); /** * SavingFailure represents a unsuccessful attempt to save * a model on the server. * * @class * @memberof module:pageflow/editor */ pageflow.SavingFailure = pageflow.Failure.extend({ type: 'SavingFailure' }); /** * OrderingFailure represent a unsuccessful attempt to save * the ordering of a pageflow.orderedCollection. * * @class * @memberof module:pageflow/editor */ pageflow.OrderingFailure = pageflow.Failure.extend({ type: 'OrderingFailure', initialize: function(model, collection) { pageflow.Failure.prototype.initialize.call(this, model); this.collection = collection; }, retryAction: function() { return this.collection.saveOrder(); } });
Version data entries
58 entries across 58 versions & 1 rubygems