@@ -49,7 +49,9 @@ $.widget( "ui.editable", {
49
49
} ,
50
50
51
51
start : function ( ) {
52
- this . _edit ( ) ;
52
+ if ( ! this . _editing ) {
53
+ this . _edit ( ) ;
54
+ }
53
55
} ,
54
56
55
57
submit : function ( ) {
@@ -92,7 +94,7 @@ $.widget( "ui.editable", {
92
94
93
95
this . element . removeClass ( highlightStateClass ) ;
94
96
95
- if ( ! this . editing && ( $this . is ( this . element ) || $this . hasClass ( placeholderClass ) ) ) {
97
+ if ( ! this . _editing && ( $this . is ( this . element ) || $this . hasClass ( placeholderClass ) ) ) {
96
98
this . element . addClass ( highlightStateClass ) ;
97
99
return ;
98
100
}
@@ -108,12 +110,12 @@ $.widget( "ui.editable", {
108
110
} ,
109
111
110
112
_show : function ( ) {
111
- this . editing = undefined ;
113
+ this . _editing = undefined ;
112
114
this . element . html ( this . value ( ) || this . _placeholder ( ) ) ;
113
115
} ,
114
116
115
117
_edit : function ( ) {
116
- this . editing = true ;
118
+ this . _editing = true ;
117
119
this . element . html ( this . _form ( ) ) ;
118
120
this . _formEvents ( ) ;
119
121
} ,
@@ -126,7 +128,7 @@ $.widget( "ui.editable", {
126
128
127
129
_form : function ( ) {
128
130
var editor = $ . ui . editable . editors [ this . options . editor ] ,
129
- form = $ ( "<form></form>" )
131
+ form = $ ( "<form></form>" )
130
132
. addClass ( formClass )
131
133
. append ( $ ( "<span></span>" )
132
134
. append ( editor . element ( this ) ) ) ;
@@ -156,7 +158,7 @@ $.widget( "ui.editable", {
156
158
157
159
_formEvents : function ( ) {
158
160
var self = this ,
159
- editor = $ . ui . editable . editors [ self . options . editor ] ;
161
+ editor = $ . ui . editable . editors [ self . options . editor ] ;
160
162
$ ( "form" , this . element )
161
163
. submit ( function ( event ) {
162
164
self . _save . call ( self , event , editor . value ( self , this ) ) ;
@@ -239,7 +241,7 @@ $.ui.editable.editors = {
239
241
. addClass ( inputClass ) ;
240
242
} ,
241
243
bind : function ( editable ) {
242
- var self = editable ;
244
+ var self = editable ;
243
245
$ ( "input" , editable . element )
244
246
. focus ( function ( ) {
245
247
self . frame . addClass ( activeStateClass ) ;
0 commit comments