| author | ymh <ymh.work@gmail.com> |
| Sat, 25 Apr 2015 04:37:06 +0200 | |
| changeset 434 | 0d5998b32a7c |
| parent 433 | e457ec945e50 |
| child 503 | 18cb4c4c4e5e |
| permissions | -rw-r--r-- |
| 284 | 1 |
|
2 |
define(['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) { |
|
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
3 |
'use strict'; |
|
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
4 |
|
| 284 | 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(); |
|
| 433 | 16 |
var _pts = _.map(_.range(8), function() {return [0,0];}); |
| 284 | 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; |
|
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
20 |
this.editor_block.opacity = 0.8; |
| 284 | 21 |
this.editor_$ = $('<div>') |
22 |
.appendTo(this.renderer.editor_$) |
|
23 |
.css({ |
|
24 |
position: "absolute", |
|
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
25 |
opacity: 0.8 |
| 284 | 26 |
}) |
27 |
.hide(); |
|
28 |
}, |
|
29 |
destroy: function() { |
|
30 |
this.editor_block.remove(); |
|
31 |
this.editor_$.remove(); |
|
32 |
} |
|
| 433 | 33 |
}).value(); |
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
34 |
|
| 284 | 35 |
/* _BaseEditor End */ |
36 |
||
37 |
return _BaseEditor; |
|
38 |
||
39 |
}); |