Plugin Keys On Map: Show message when the plugin disabled.
This commit is contained in:
parent
6cef4d99e4
commit
3caaaf5164
@ -28,8 +28,10 @@ window.plugin.keysOnMap.keyLayerGroup = new L.LayerGroup();
|
|||||||
// Use portal add and remove event to control render of keys
|
// Use portal add and remove event to control render of keys
|
||||||
window.plugin.keysOnMap.portalAdded = function(data) {
|
window.plugin.keysOnMap.portalAdded = function(data) {
|
||||||
// Disable if Plugin Keys is not there
|
// Disable if Plugin Keys is not there
|
||||||
if(!plugin.keys)
|
if(!plugin.keys) {
|
||||||
|
plugin.keysOnMap.disableMessage();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
data.portal.on('add', function() {
|
data.portal.on('add', function() {
|
||||||
plugin.keysOnMap.renderKey(this.options.guid, this.getLatLng());
|
plugin.keysOnMap.renderKey(this.options.guid, this.getLatLng());
|
||||||
@ -42,9 +44,10 @@ window.plugin.keysOnMap.portalAdded = function(data) {
|
|||||||
|
|
||||||
window.plugin.keysOnMap.keyUpdate = function(data) {
|
window.plugin.keysOnMap.keyUpdate = function(data) {
|
||||||
// Disable if Plugin Keys is not there
|
// Disable if Plugin Keys is not there
|
||||||
if(!plugin.keys)
|
if(!plugin.keys) {
|
||||||
|
plugin.keysOnMap.disableMessage();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
var portal = window.portals[data.guid];
|
var portal = window.portals[data.guid];
|
||||||
if(!portal) return;
|
if(!portal) return;
|
||||||
var latLng = portal.getLatLng();
|
var latLng = portal.getLatLng();
|
||||||
@ -80,6 +83,13 @@ window.plugin.keysOnMap.removeKey = function(guid) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.plugin.keysOnMap.disableMessage = function() {
|
||||||
|
if(!plugin.keysOnMap.messageShown) {
|
||||||
|
alert('Plugin "Keys On Map" need plugin "Keys" to run!');
|
||||||
|
plugin.keysOnMap.messageShown = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var setup = function() {
|
var setup = function() {
|
||||||
$("<style>")
|
$("<style>")
|
||||||
.prop("type", "text/css")
|
.prop("type", "text/css")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user