'use strict';
var mixer = require('../mixin/mixer'),
    errorMessage = require('../factory/errorMessage');

var createMessage = errorMessage.create,
    errorTypes = errorMessage.types;

/**
 * View interface
 * @class View
 * @mixes Delegator
 * @param {View} parent - Parent view
 */
var View = tui.util.defineClass(/* @lends View.prototype */{
    init: function(parent, $wrapper) {
        /**
         * jQuery Element
         * @type {jQuery}
         */
        this.$wrapper = $wrapper;

        this.setParent(parent);
    },


    /**
     * Get image name
     * @returns {ImageEditor}
     */
    getEditor: function() {
        if (this === this.getRoot()) {
            return this.editor;
        }

        return this.getRoot().getEditor();
    },

    /**
     * Return jquery element
     * @returns {jQuery}
     */
    getElement: function() {
        return this.$element;
    },

    /**
     * Set jquery element
     * @param {jQuery} $element - jQuery element
     */
    setElement: function($element) {
        this.$element = $element;
    },

    /**
     * Return view name
     * @returns {string}
     */
    getName: function() {
        var name = this.name;

        if (!name) {
            throw new Error(createMessage(errorTypes.NO_VIEW_NAME));
        }

        return name;
    },

    /**
     * HTML Template method
     * @returns {string}
     * @protected
     */
    template: function() {
        return '';
    },

    /**
     * Render view
     */
    render: function() {
        var ctx = this.templateContext;

        this.destroy();
        this.$element = $(this.template(ctx));

        if (this.$wrapper) {
            this.$wrapper.append(this.$element);
        }

        if (this.doAfterRender) {
            this.doAfterRender();
        }
    },

    /**
     * Destroy view
     */
    destroy: function() {
        if (this.doBeforeDestroy) {
            this.doBeforeDestroy();
        }
        if (this.$element) {
            this.$element.remove();
            this.$element = null;
        }
    }
});

mixer.mixin(View, 'Delegator');
module.exports = View;

@@ -535,238 +535,8 @@
 %7D,%0A%0A
-%0A    /**%0A     * Get image name%0A     * @returns %7BImageEditor%7D%0A     */%0A    getEditor: function() %7B%0A        if (this === this.getRoot()) %7B%0A            return this.editor;%0A        %7D%0A%0A        return this.getRoot().getEditor();%0A    %7D,%0A%0A
     

remove "getEditor" in view.js