/**
 * author : SungYong Jang <jsy@adain.kr>
 * date : 2015. 7. 14.
 * description : MyCommand
 */

import { Command, CommandFactory } from 'meteor/adain:meteor-command-pattern';


/**
 * add div command
 * @class
 */
export default class AddDivCommand extends Command{

  /**
   * init command
   * @param {CommandStack} stack
   * @param {string} [_userId]
   * @param {object} [property]
   * @param {string} [oldProperty]
   * @param {string} [guid]
   */
  constructor(stack, _userId, property, oldProperty, guid){
    super(stack, _userId, property, oldProperty, guid);
    this.type = 'AddDivCommand';
  }

  /**
   * exec
   * @method
   * @override
   */
  exec(){
    $("body").append("<div id='" + this.guid + "'>" + this.property.text + "</div>");
  }

  /**
   * undo
   * @override
   * @method
   */
  undo(){
    $("#" + this.guid).remove();
  }
}

/**
 * add to command factory
 */
CommandFactory.add('AddDivCommand', AddDivCommand);
@@ -423,36 +423,8 @@
 ty%5D%0A
-   * @param %7Bstring%7D %5Bguid%5D%0A
    *
@@ -476,22 +476,16 @@
 Property
-, guid
 )%7B%0A    s
@@ -530,14 +530,8 @@
 erty
-, guid
 );%0A 

remove guid from AddDivCommand