Sha256: 229f8cf0e6e3610c5ffd9730d7ff282f735cf9d7a1a627bf4a841770adadcc35
Contents?: true
Size: 1.41 KB
Versions: 33
Compression:
Stored size: 1.41 KB
Contents
pageflow.FileStageItemView = Backbone.Marionette.ItemView.extend({ tagName: 'li', className: 'file_stage_item', template: 'templates/file_stage_item', ui: { description: '.description', percent: '.percent', errorMessage: '.error_message' }, modelEvents: { 'change': 'update' }, onRender: function() { this.update(); this.$el.addClass(this.model.get('name')); if (this.options.standAlone) { this.$el.addClass('stand_alone'); } else { this.$el.addClass('indented'); } }, update: function() { this.ui.description.text(this.model.localizedDescription()); if (typeof this.model.get('progress') === 'number' && this.model.get('active')) { this.ui.percent.text(this.model.get('progress') + '%'); } else { this.ui.percent.text(''); } this.ui.errorMessage .toggle(!!this.model.get('error_message')) .text(this._translatedErrorMessage()); this.$el.toggleClass('active', this.model.get('active')); this.$el.toggleClass('finished', this.model.get('finished')); this.$el.toggleClass('failed', this.model.get('failed')); this.$el.toggleClass('action_required', this.model.get('action_required')); }, _translatedErrorMessage: function() { return this.model.get('error_message') && I18n.t(this.model.get('error_message'), { defaultValue: this.model.get('error_message') }); } });
Version data entries
33 entries across 33 versions & 1 rubygems