add option for custom marker renderer
This commit is contained in:
parent
8ac379a71e
commit
c227436dde
1 changed files with 7 additions and 1 deletions
|
|
@ -61,6 +61,7 @@ var Marker = function(parentEl) {
|
||||||
this.markers[id] = {
|
this.markers[id] = {
|
||||||
range : range,
|
range : range,
|
||||||
type : type || "line",
|
type : type || "line",
|
||||||
|
renderer: typeof type == "function" ? type : null,
|
||||||
clazz : clazz
|
clazz : clazz
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -90,7 +91,12 @@ var Marker = function(parentEl) {
|
||||||
|
|
||||||
range = range.toScreenRange(this.session);
|
range = range.toScreenRange(this.session);
|
||||||
|
|
||||||
if (range.isMultiLine()) {
|
if (marker.renderer) {
|
||||||
|
var top = this.$getTop(range.start.row, config);
|
||||||
|
var left = Math.round(range.start.column * config.characterWidth);
|
||||||
|
marker.renderer(html, range, left, top, config);
|
||||||
|
}
|
||||||
|
else if (range.isMultiLine()) {
|
||||||
if (marker.type == "text") {
|
if (marker.type == "text") {
|
||||||
this.drawTextMarker(html, range, marker.clazz, config);
|
this.drawTextMarker(html, range, marker.clazz, config);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue