Revision 236223aa snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js

b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js
63 63
            views.NetworkConnectVMsOverlay.__super__.initialize.apply(this);
64 64
            this.list = this.$(".vms-list ul");
65 65
            this.empty_message = this.$(".empty-message");
66

  
67
            // flag for submit handler to avoid duplicate bindings
68
            this.submit_handler_set = false;
66 69
        },
67 70
        
68 71
        init_handlers: function() {
......
70 73
            this.list.find("li").click(function(){
71 74
                $(this).toggleClass("selected");
72 75
            });
73

  
74
            this.el.find(".create").click(_.bind(function() {
75
                this.submit();
76
            }, this));
76
            
77
            if (!this.submit_handler_set) {
78
                // avoid duplicate submits
79
                this.el.find(".create").click(_.bind(function() {
80
                    this.submit();
81
                }, this));
82
                this.submit_handler_set = true;
83
            }
77 84
        },
78 85

  
79 86
        reset: function() {
......
119 126
                vm.bind("remove", function(){ el.remove()})
120 127
                vm.bind("change:name", function(i,v){el.find(".title").text(v)})
121 128
            }, this));
122

  
129
            
123 130
            this.init_handlers();
124 131
            this.set_selected();
125 132
        },

Also available in: Unified diff