| author | ymh <ymh.work@gmail.com> |
| Sat, 25 Apr 2015 04:37:06 +0200 | |
| changeset 434 | 0d5998b32a7c |
| parent 433 | e457ec945e50 |
| permissions | -rw-r--r-- |
| 284 | 1 |
|
2 |
define(['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) { |
|
|
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 |
/* EdgeRemoveButton Begin */ |
|
8 |
||
9 |
//var EdgeRemoveButton = Renderer.EdgeRemoveButton = Utils.inherit(Renderer._BaseButton); |
|
10 |
var EdgeRemoveButton = Utils.inherit(BaseButton); |
|
11 |
||
12 |
_(EdgeRemoveButton.prototype).extend({ |
|
13 |
_init: function() { |
|
14 |
this.type = "Edge-remove-button"; |
|
15 |
this.sector = this.renderer.drawSector(this, Utils._EDGE_BUTTON_INNER, Utils._EDGE_BUTTON_OUTER, -90, 90, 1, "remove", this.renkan.translate("Remove")); |
|
16 |
}, |
|
17 |
mouseup: function() { |
|
18 |
this.renderer.click_target = null; |
|
19 |
this.renderer.is_dragging = false; |
|
20 |
this.renderer.removeRepresentationsOfType("editor"); |
|
21 |
if (this.renderer.isEditable()) { |
|
22 |
if (this.options.element_delete_delay) { |
|
23 |
var delid = Utils.getUID("delete"); |
|
24 |
this.renderer.delete_list.push({ |
|
25 |
id: delid, |
|
26 |
time: new Date().valueOf() + this.options.element_delete_delay |
|
27 |
}); |
|
28 |
this.source_representation.model.set("delete_scheduled", delid); |
|
29 |
} else { |
|
30 |
if (confirm(this.renkan.translate('Do you really wish to remove edge ') + '"' + this.source_representation.model.get("title") + '"?')) { |
|
31 |
this.project.removeEdge(this.source_representation.model); |
|
32 |
} |
|
33 |
} |
|
34 |
} |
|
35 |
} |
|
| 433 | 36 |
}).value(); |
| 284 | 37 |
|
38 |
/* EdgeRemoveButton End */ |
|
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
39 |
|
| 284 | 40 |
return EdgeRemoveButton; |
41 |
||
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
42 |
}); |