code: function() {
        var t = this;
  
        // Add the component to the model, then to the page view
        var copy = t.model.toJSON();
        delete copy.id;
        var component = t.pageView.model.addComponent(copy.viewClass);
        component.set(copy);
  
        // Position the component on top left
        var cv = t.pageView.getComponentView(component.get('id'));
        cv.raiseToTop(true);
        cv.moveToLeft();
        t.pageView.leftJustify();
        t.pageView.centerPage();
  
        // Close the dialog box
        t.closeDialog();
      }
docs: Copy the component