-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add toolbar item for generic Point/Line/Area presets for simpler lega…
…cy workflow compatibility (close #6458)
- Loading branch information
1 parent
4dd6d3f
commit 966eecd
Showing
8 changed files
with
59 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { t } from '../../util/locale'; | ||
import { uiToolQuickPresets } from './quick_presets'; | ||
|
||
export function uiToolAddGeneric(context) { | ||
|
||
var tool = uiToolQuickPresets(context); | ||
tool.id = 'add_generic'; | ||
tool.label = t('toolbar.generic.title'); | ||
tool.iconName = 'iD-logo-features'; | ||
tool.iconClass = 'icon-30'; | ||
|
||
if (context.storage('tool.add_generic.toggledOn') === null) { | ||
if (!context.isFirstSession) { | ||
// assume existing user coming from iD 2, enable this item by default | ||
tool.isToggledOn = true; | ||
} else { | ||
tool.isToggledOn = false; | ||
} | ||
context.storage('tool.add_generic.toggledOn', tool.isToggledOn); | ||
} | ||
|
||
tool.itemsToDraw = function() { | ||
if (context.presets().getAddable().length) return []; | ||
var items = context.presets().getGenericRibbonItems(); | ||
for (var i in items) { | ||
items[i].key = (parseInt(i, 10) + 1).toString(); | ||
} | ||
return items; | ||
}; | ||
|
||
return tool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters