Don't disable boundries when disable_features list is present

(also removed some unused functions)
This commit is contained in:
Bryan Housel
2017-10-23 15:53:46 -04:00
parent dbf85dae43
commit 30ff68348f
3 changed files with 16 additions and 31 deletions

9
dist/index.html vendored
View File

@@ -36,9 +36,16 @@
if (typeof iD == 'undefined' || !iD.Detect().support) {
document.getElementById('id-container').innerHTML = 'Sorry, your browser is not currently supported. Please use Potlatch 2 to edit the map.';
document.getElementById('id-container').className = 'unsupported';
} else {
var id = iD.Context();
id.features().disable('boundaries');
// disable boundaries (unless we have an explicit disable_features list)
var q = iD.utilStringQs(window.location.hash.substring(1));
if (!q.hasOwnProperty('disable_features')) {
id.features().disable('boundaries');
}
id.ui()(document.getElementById('id-container'));
}
</script>

View File

@@ -16,7 +16,11 @@
id = iD.Context()
.assetPath('dist/');
id.features().disable('boundaries');
// disable boundaries (unless we have an explicit disable_features list)
var q = iD.utilStringQs(window.location.hash.substring(1));
if (!q.hasOwnProperty('disable_features')) {
id.features().disable('boundaries');
}
id.ui()(document.getElementById('id-container'), function() {
id.container().select('#about-list')

View File

@@ -214,10 +214,6 @@ export function rendererFeatures(context) {
return _features[k] && _features[k].enabled;
};
features.enabledList = function () {
return _keys.filter(function(k) { return _features[k].enabled; });
};
features.disabled = function(k) {
if (!arguments.length) {
@@ -250,28 +246,6 @@ export function rendererFeatures(context) {
}
};
features.enableList = function (enabledKeys) {
var keysForToggle = {};
for (var i = 0; i < _keys.length; i++) {
keysForToggle[_keys[i]] = false;
}
for (i = 0; i < enabledKeys.length; i++) {
if (_features[enabledKeys[i]]) {
keysForToggle[enabledKeys[i]] = true;
}
}
for (i = 0; i < _keys.length; i++) {
if (keysForToggle[_keys[i]]) {
_features[_keys[i]].enable();
} else {
_features[_keys[i]].disable();
}
}
};
features.disable = function(k) {
if (_features[k] && _features[k].enabled) {
@@ -505,10 +479,10 @@ export function rendererFeatures(context) {
features.init = function() {
var q = utilStringQs(window.location.hash.substring(1));
if (q.disable_features) {
q.disable_features.replace(/;/g, ',').split(',').map(function(k) {
features.disable(k);
});
var disabled = q.disable_features.replace(/;/g, ',').split(',');
disabled.forEach(features.disable);
}
};