Skip to content

Commit

Permalink
Update layer input style and refactor OpenLayers command
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Feb 2, 2018
1 parent ca8fba3 commit 566516c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dist/css/grapes.min.css

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions src/commands/view/OpenLayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const Layers = require('navigator');
const $ = Backbone.$;

module.exports = {
/*
run(em, sender) {
if (!this.toAppend) {
var collection = em.DomComponents.getComponent().get('components');
Expand Down Expand Up @@ -34,5 +35,27 @@ module.exports = {
stop() {
this.toAppend && this.toAppend.hide();
},
*/

run(editor) {
const lm = editor.LayerManager;
const pn = editor.Panels;

if (!this.layers) {
const id = 'views-container';
const layers = document.createElement('div');
const panels = pn.getPanel(id) || pn.addPanel({ id });
layers.appendChild(lm.render());
panels.set('appendContent', layers).trigger('change:appendContent');
this.layers = layers;
}

this.layers.style.display = 'block';
},

stop() {
const layers = this.layers;
layers && (layers.style.display = 'none');
}
};
2 changes: 2 additions & 0 deletions src/navigator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module.exports = () => {
options.collection = collection;
}

console.log('options', options);
layers = new View(options);
em && em.on('component:selected', this.componentChanged);
this.componentChanged();
Expand Down Expand Up @@ -78,6 +79,7 @@ module.exports = () => {
},

render() {
console.log('render layers');
return layers.render().el;
}
};
Expand Down
1 change: 1 addition & 0 deletions src/styles/scss/_gjs_layers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

&-name {
padding: 5px;
font-size: 11px;
display: inline-block;
box-sizing: content-box;
@extend .#{$app-prefix}no-user-select;
Expand Down

0 comments on commit 566516c

Please sign in to comment.