mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-30 23:03:03 -07:00
CR/LF correction
This commit is contained in:
73
front/lib/AdminLTE/bower_components/jvectormap/src/map-object.js
vendored
Normal file
73
front/lib/AdminLTE/bower_components/jvectormap/src/map-object.js
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
jvm.MapObject = function(config){};
|
||||
|
||||
jvm.MapObject.prototype.getLabelText = function(key){
|
||||
var text;
|
||||
|
||||
if (this.config.label) {
|
||||
if (typeof this.config.label.render === 'function') {
|
||||
text = this.config.label.render(key);
|
||||
} else {
|
||||
text = key;
|
||||
}
|
||||
} else {
|
||||
text = null;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
jvm.MapObject.prototype.getLabelOffsets = function(key){
|
||||
var offsets;
|
||||
|
||||
if (this.config.label) {
|
||||
if (typeof this.config.label.offsets === 'function') {
|
||||
offsets = this.config.label.offsets(key);
|
||||
} else if (typeof this.config.label.offsets === 'object') {
|
||||
offsets = this.config.label.offsets[key];
|
||||
}
|
||||
}
|
||||
return offsets || [0, 0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set hovered state to the element. Hovered state means mouse cursor is over element. Styles will be updates respectively.
|
||||
* @param {Boolean} isHovered <code>true</code> to make element hovered, <code>false</code> otherwise.
|
||||
*/
|
||||
jvm.MapObject.prototype.setHovered = function(isHovered){
|
||||
if (this.isHovered !== isHovered) {
|
||||
this.isHovered = isHovered;
|
||||
this.shape.isHovered = isHovered;
|
||||
this.shape.updateStyle();
|
||||
if (this.label) {
|
||||
this.label.isHovered = isHovered;
|
||||
this.label.updateStyle();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Set selected state to the element. Styles will be updates respectively.
|
||||
* @param {Boolean} isSelected <code>true</code> to make element selected, <code>false</code> otherwise.
|
||||
*/
|
||||
jvm.MapObject.prototype.setSelected = function(isSelected){
|
||||
if (this.isSelected !== isSelected) {
|
||||
this.isSelected = isSelected;
|
||||
this.shape.isSelected = isSelected;
|
||||
this.shape.updateStyle();
|
||||
if (this.label) {
|
||||
this.label.isSelected = isSelected;
|
||||
this.label.updateStyle();
|
||||
}
|
||||
jvm.$(this.shape).trigger('selected', [isSelected]);
|
||||
}
|
||||
};
|
||||
|
||||
jvm.MapObject.prototype.setStyle = function(){
|
||||
this.shape.setStyle.apply(this.shape, arguments);
|
||||
};
|
||||
|
||||
jvm.MapObject.prototype.remove = function(){
|
||||
this.shape.remove();
|
||||
if (this.label) {
|
||||
this.label.remove();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user