-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: import layer button (#1685)
* feature: import layer button Fixes #1678 Adds a button in the legend for import of layer as file. Defaults to false. { "name": "draganddrop", "options": { "showLegendButton": true } }, * Fix for readding layers * Changed icon * Added popup menu for add layer * Update legend.js * Some css * Added some styling
- Loading branch information
Showing
8 changed files
with
201 additions
and
33 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,33 @@ | ||
import Component from './component'; | ||
|
||
export default function Input(options = {}) { | ||
const { | ||
labelCls = '', | ||
inputCls = '', | ||
label = '', | ||
change | ||
} = options; | ||
|
||
return Component({ | ||
onInit() { | ||
if (change) { | ||
this.on('change', change.bind(this)); | ||
this.on('clear', () => { | ||
this.un('change', change.bind(this)); | ||
}); | ||
} | ||
}, | ||
onRender() { | ||
const el = document.getElementById(this.getId()); | ||
el.addEventListener('change', this.onChange.bind(this)); | ||
}, | ||
onChange(evt) { | ||
this.dispatch('change', evt); | ||
}, | ||
render() { | ||
return ` | ||
<label for="${this.getId()}" class="${labelCls}">${label}</label><input id="${this.getId()}" type="file" class="${inputCls}"> | ||
`; | ||
} | ||
}); | ||
} |
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