client/js/renderer/baseeditor.js
changeset 284 fa8035885814
child 293 fba23fde14ba
equal deleted inserted replaced
283:67f3a24a7c01 284:fa8035885814
       
     1 "use strict";
       
     2 
       
     3 define(['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) {
       
     4     
       
     5     var Utils = requtils.getUtils();
       
     6 
       
     7     /* _BaseEditor Begin */
       
     8     //var _BaseEditor = Renderer._BaseEditor = Utils.inherit(Renderer._BaseRepresentation);
       
     9     var _BaseEditor = Utils.inherit(BaseRepresentation);
       
    10 
       
    11     _(_BaseEditor.prototype).extend({
       
    12         _init: function() {
       
    13             this.renderer.buttons_layer.activate();
       
    14             this.type = "editor";
       
    15             this.editor_block = new paper.Path();
       
    16             var _pts = _(_.range(8)).map(function() {return [0,0];});
       
    17             this.editor_block.add.apply(this.editor_block, _pts);
       
    18             this.editor_block.strokeWidth = this.options.tooltip_border_width;
       
    19             this.editor_block.strokeColor = this.options.tooltip_border_color;
       
    20             this.editor_block.opacity = .8;
       
    21             this.editor_$ = $('<div>')
       
    22             .appendTo(this.renderer.editor_$)
       
    23             .css({
       
    24                 position: "absolute",
       
    25                 opacity: .8
       
    26             })
       
    27             .hide();
       
    28         },
       
    29         destroy: function() {
       
    30             this.editor_block.remove();
       
    31             this.editor_$.remove();
       
    32         }
       
    33     });
       
    34     
       
    35     /* _BaseEditor End */
       
    36 
       
    37     return _BaseEditor;
       
    38 
       
    39 });