Differential D12033 Diff 29183 webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js
Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js
| Show First 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | members : { | ||||
| }, | }, | ||||
| start : function() { | start : function() { | ||||
| this._registerUndoListener(); | this._registerUndoListener(); | ||||
| var data = this._buildRequestData(); | var data = this._buildRequestData(); | ||||
| var op = this.getOperation(); | var op = this.getOperation(); | ||||
| if (op == 'delete' || op == 'refdelete' || op == 'undelete') { | if (op == 'delete' || op == 'refdelete' || op == 'undelete') { | ||||
| this._setRowState('loading'); | this._setRowState('loading'); | ||||
| var oncomplete = JX.bind(this, this._didCompleteWorkflow); | var oncomplete = JX.bind(this, this._didCompleteWorkflow); | ||||
| var oncancel = JX.bind(this, this._didCancelWorkflow); | var oncancel = JX.bind(this, this._didCancelWorkflow); | ||||
| new JX.Workflow(this._uri, data) | new JX.Workflow(this._uri, data) | ||||
| .setHandler(oncomplete) | .setHandler(oncomplete) | ||||
| Show All 12 Lines | start : function() { | ||||
| } | } | ||||
| return this; | return this; | ||||
| }, | }, | ||||
| deleteByID: function(id) { | deleteByID: function(id) { | ||||
| var data = { | var data = { | ||||
| op: 'refdelete', | op: 'refdelete', | ||||
| changesetID: id | id: id | ||||
| }; | }; | ||||
| new JX.Workflow(this._uri, data) | new JX.Workflow(this._uri, data) | ||||
| .setHandler(function() { | .setHandler(JX.bind(this, function() { | ||||
| JX.Stratcom.invoke('differential-inline-comment-update'); | this._didUpdate(); | ||||
| }) | })) | ||||
| .start(); | |||||
| }, | |||||
| toggleCheckbox: function(id, checkbox) { | |||||
| var data = { | |||||
| op: 'done', | |||||
| id: id | |||||
| }; | |||||
| new JX.Workflow(this._uri, data) | |||||
| .setHandler(JX.bind(this, function() { | |||||
| checkbox.checked = !checkbox.checked; | |||||
| this._didUpdate(); | |||||
| })) | |||||
| .start(); | .start(); | ||||
| }, | |||||
| _didUpdate: function() { | |||||
| JX.Stratcom.invoke('differential-inline-comment-update'); | |||||
| } | } | ||||
| }, | }, | ||||
| statics : { | statics : { | ||||
| /** | /** | ||||
| * Global refernece to the 'undo' rows currently rendered in the document. | * Global refernece to the 'undo' rows currently rendered in the document. | ||||
| */ | */ | ||||
| Show All 28 Lines | |||||