56 lines
1.5 KiB
JavaScript
56 lines
1.5 KiB
JavaScript
// Generated by CoffeeScript 1.12.5
|
|
import Ember from 'ember';
|
|
|
|
export default Ember.Component.extend({
|
|
tagName: 'span',
|
|
classNames: ['project-instance-action-value-display'],
|
|
eventIO: null,
|
|
project_instance_action: null,
|
|
value_type: Ember.computed.alias('project_instance_action.workflow_action_definition.value_type'),
|
|
save: function() {},
|
|
doubleClick: function() {
|
|
var eventIO;
|
|
eventIO = this.get('eventIO');
|
|
if (eventIO != null) {
|
|
Ember.run.cancel(eventIO);
|
|
this.set('eventIO', null);
|
|
}
|
|
if (this.get('value_type') === 'boolean') {
|
|
return this.modal('project/edit-instance-action', {
|
|
model: this.get('project_instance_action'),
|
|
save: this.save,
|
|
close: this.save
|
|
});
|
|
} else {
|
|
return this.modal('project/edit-instance-action', {
|
|
model: this.get('project_instance_action'),
|
|
save: this.save,
|
|
close: this.save
|
|
});
|
|
}
|
|
},
|
|
click: function() {
|
|
var eventIO;
|
|
if (this.get('eventIO') === null) {
|
|
eventIO = Ember.run.later(this, function() {
|
|
this.modal('project/edit-instance-action', {
|
|
model: this.get('project_instance_action'),
|
|
save: this.save,
|
|
close: this.save
|
|
});
|
|
if (this.get('eventIO') !== null) {
|
|
Ember.run.cancel(this.get('eventIO'));
|
|
return this.set('eventIO', null);
|
|
}
|
|
}, 500);
|
|
return this.set('eventIO', eventIO);
|
|
}
|
|
},
|
|
actions: {
|
|
right_click: function() {
|
|
debugger;
|
|
return false;
|
|
}
|
|
}
|
|
});
|