Permalink
Browse files

Fixed initial state

  • Loading branch information...
1 parent 82c3fee commit 40228837c6ba9017c17388ca7eac497203cff441 Dmitry Demeshchuk committed Jan 28, 2014
Showing with 6 additions and 4 deletions.
  1. +3 −2 wrike.com/approve.coffee
  2. +3 −2 wrike.com/approve.js
@@ -6,7 +6,8 @@
'initial': {
triggers: {
'Send for approval': 'onApproval'
- }
+ },
+ owner: true
},
'onApproval': {
triggers: {
@@ -150,7 +151,7 @@
applyState: (newState) ->
newPrefix = '[' + states[newState].titleTag + '] '
if @state is 'initial'
- @title.val(newPrefix + @title.val())
+ @title.val(@title.val())
else
@title.val(@title.val().replace(/^\[.+\]\s/, newPrefix))
@@ -7,7 +7,8 @@
'initial': {
triggers: {
'Send for approval': 'onApproval'
- }
+ },
+ owner: true
},
'onApproval': {
triggers: {
@@ -189,7 +190,7 @@
var newPrefix;
newPrefix = '[' + states[newState].titleTag + '] ';
if (this.state === 'initial') {
- this.title.val(newPrefix + this.title.val());
+ this.title.val(this.title.val());
} else {
this.title.val(this.title.val().replace(/^\[.+\]\s/, newPrefix));
}

0 comments on commit 4022883

Please sign in to comment.