Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffInline.js
| Show All 30 Lines | members: { | ||||
| _isCollapsed: false, | _isCollapsed: false, | ||||
| _isDraft: null, | _isDraft: null, | ||||
| _isDraftDone: null, | _isDraftDone: null, | ||||
| _isFixed: null, | _isFixed: null, | ||||
| _isEditing: false, | _isEditing: false, | ||||
| _isNew: false, | _isNew: false, | ||||
| _isSynthetic: false, | _isSynthetic: false, | ||||
| _isHidden: false, | |||||
| bindToRow: function(row) { | bindToRow: function(row) { | ||||
| this._row = row; | this._row = row; | ||||
| var row_data = JX.Stratcom.getData(row); | var row_data = JX.Stratcom.getData(row); | ||||
| row_data.inline = this; | row_data.inline = this; | ||||
| this._isCollapsed = row_data.hidden || false; | this._isCollapsed = row_data.hidden || false; | ||||
| ▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | members: { | ||||
| isSynthetic: function() { | isSynthetic: function() { | ||||
| return this._isSynthetic; | return this._isSynthetic; | ||||
| }, | }, | ||||
| isDraftDone: function() { | isDraftDone: function() { | ||||
| return this._isDraftDone; | return this._isDraftDone; | ||||
| }, | }, | ||||
| isHidden: function() { | |||||
| return this._isHidden; | |||||
| }, | |||||
| isGhost: function() { | |||||
| return this._isGhost; | |||||
| }, | |||||
| bindToRange: function(data) { | bindToRange: function(data) { | ||||
| this._displaySide = data.displaySide; | this._displaySide = data.displaySide; | ||||
| this._number = parseInt(data.number, 10); | this._number = parseInt(data.number, 10); | ||||
| this._length = parseInt(data.length, 10); | this._length = parseInt(data.length, 10); | ||||
| this._isNewFile = data.isNewFile; | this._isNewFile = data.isNewFile; | ||||
| this._changesetID = data.changesetID; | this._changesetID = data.changesetID; | ||||
| this._isNew = true; | this._isNew = true; | ||||
| ▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | getChangeset: function() { | ||||
| return this._changeset; | return this._changeset; | ||||
| }, | }, | ||||
| setEditing: function(editing) { | setEditing: function(editing) { | ||||
| this._isEditing = editing; | this._isEditing = editing; | ||||
| return this; | return this; | ||||
| }, | }, | ||||
| setHidden: function(hidden) { | |||||
| this._isHidden = hidden; | |||||
| this._redraw(); | |||||
| return this; | |||||
| }, | |||||
| canReply: function() { | canReply: function() { | ||||
| if (!this._hasAction('reply')) { | if (!this._hasAction('reply')) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| return true; | return true; | ||||
| }, | }, | ||||
| ▲ Show 20 Lines • Show All 485 Lines • ▼ Show 20 Lines | _didUpdate: function(local_only) { | ||||
| this.getChangeset().getChangesetList().resetHover(); | this.getChangeset().getChangesetList().resetHover(); | ||||
| // Emit a resize event so that UI elements like the keyboard focus | // Emit a resize event so that UI elements like the keyboard focus | ||||
| // reticle can redraw properly. | // reticle can redraw properly. | ||||
| JX.Stratcom.invoke('resize'); | JX.Stratcom.invoke('resize'); | ||||
| }, | }, | ||||
| _redraw: function() { | _redraw: function() { | ||||
| var is_invisible = (this._isInvisible || this._isDeleted); | var is_invisible = | ||||
| (this._isInvisible || this._isDeleted || this._isHidden); | |||||
| var is_loading = this._isLoading; | var is_loading = this._isLoading; | ||||
| var is_collapsed = this._isCollapsed; | var is_collapsed = (this._isCollapsed && !this._isHidden); | ||||
| var row = this._row; | var row = this._row; | ||||
| JX.DOM.alterClass(row, 'differential-inline-hidden', is_invisible); | JX.DOM.alterClass(row, 'differential-inline-hidden', is_invisible); | ||||
| JX.DOM.alterClass(row, 'differential-inline-loading', is_loading); | JX.DOM.alterClass(row, 'differential-inline-loading', is_loading); | ||||
| JX.DOM.alterClass(row, 'inline-hidden', is_collapsed); | JX.DOM.alterClass(row, 'inline-hidden', is_collapsed); | ||||
| }, | }, | ||||
| _removeRow: function(row) { | _removeRow: function(row) { | ||||
| Show All 14 Lines | |||||