Revision 5939efeb

b/ui/static/snf/js/ui/web/ui_icon_view.js
193 193
            // give edit focus
194 194
            this.$('input').focus();
195 195
            // handle enter press
196
            this.$('input').keypress(function(ev){
197
                if (ev.charCode == 13) {
198
                    self.submit();
199
                }
196
            this.$('input').keydown(function(ev){
197
                ev.keyCode = ev.keyCode || ev.which;
198
                if (ev.keyCode == 13) { self.submit(); }
199
                if (ev.keyCode == 27) { self.renaming = false; self.update_layout(); }
200 200
            })
201 201
        },
202 202
        
b/ui/static/snf/js/ui/web/ui_metadata_view.js
165 165
                    this.$(".editor .create").removeClass('in-progress');
166 166
                }, this));
167 167
            } else {
168
                this.editing = true;
168 169
                this.editor.find(".form-field label").addClass("error");
169 170
            }
170 171

  
......
205 206
            })
206 207
            
207 208
            this.editor.find("input").keyup(_.bind(function(e){
209
                e.keyCode = e.keyCode || e.which;
208 210
                if (e.keyCode == 13) { this.submit_editor() };    
211
                if (e.keyCode == 27) { this.close_editor() };    
209 212
            }, this));
210 213

  
211 214
            this.editor.find(".predefined-meta-key").click(function() {
b/ui/static/snf/js/ui/web/ui_networks_view.js
362 362
            this.input.val(this.network.get("name"));
363 363
            this.el.append(this.input);
364 364
            this.input.focus();
365
            this.input.bind("keypress", _.bind(function(ev){
366
                if (ev.which == 13) {
367
                    this.submit();
368
                }
369
                if (ev.keyCode == 17) {this.editing = false; this.update_layout()};
365
            this.input.bind("keydown", _.bind(function(ev){
366
                ev.keyCode = ev.keyCode || ev.which;
367
                if (ev.keyCode == 13) { this.submit(); };
368
                if (ev.keyCode == 27) {this.editing = false; this.update_layout()};
370 369
            }, this));
371 370
        },
372 371

  

Also available in: Unified diff