Skip to content

Commit

Permalink
update editor UI text
Browse files Browse the repository at this point in the history
  • Loading branch information
goldpbear committed May 12, 2017
1 parent 8ce176d commit 36a947c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
12 changes: 10 additions & 2 deletions src/base/jstemplates/place-form-field-types.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,16 @@
<button class="create-polygon"><img src="/static/css/images/create-polygon-icon.svg"><span>{{#_}}Create polygon{{/_}}</span></button>
</div>
<div class="geometry-toolbar-edit hidden">
<button class="edit-geometry"><img src="/static/css/images/edit-geometry-icon.svg"><span>{{#_}}Edit shape{{/_}}</span></button>
<button class="delete-geometry"><img src="/static/css/images/delete-geometry-icon.svg"><span>{{#_}}Delete shape{{/_}}</span></button>
<button class="edit-geometry"><img src="/static/css/images/edit-geometry-icon.svg">
<span class="edit-geometry-Point hidden">{{#_}}Edit marker{{/_}}</span>
<span class="edit-geometry-LineString hidden">{{#_}}Edit polyline{{/_}}</span>
<span class="edit-geometry-Polygon hidden">{{#_}}Edit polygon{{/_}}</span>
</button>
<button class="delete-geometry"><img src="/static/css/images/delete-geometry-icon.svg">
<span class="delete-geometry-Point hidden">{{#_}}Delete marker{{/_}}</span>
<span class="delete-geometry-LineString hidden">{{#_}}Delete polyline{{/_}}</span>
<span class="delete-geometry-Polygon hidden">{{#_}}Delete polygon{{/_}}</span>
</button>
<button class="colorpicker"><img src="/static/css/images/colorpicker-icon.svg"><span>{{#_}}Change colors{{/_}}</span></button>
</div>
<div class="clearfix"></div>
Expand Down
26 changes: 21 additions & 5 deletions src/base/static/js/views/geometry-editor-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ module.exports = Backbone.View.extend({
this.layerType = "Point";
this.setGeometryToolbarHighlighting(evt.currentTarget);
this.displayHelpMessage("draw-marker-geometry-msg");
this.updateButtonText(this.layerType);
this.setEditingCursor();
this.delegateEvents();
this.isEditing = false;
Expand All @@ -268,6 +269,7 @@ module.exports = Backbone.View.extend({
this.hideIconToolbar();
this.setGeometryToolbarHighlighting(evt.currentTarget);
this.displayHelpMessage("draw-poly-geometry-start-msg");
this.updateButtonText(this.layerType);
this.setEditingCursor();
this.isEditing = false;
},
Expand Down Expand Up @@ -295,6 +297,7 @@ module.exports = Backbone.View.extend({
this.hideIconToolbar();
this.setGeometryToolbarHighlighting(evt.currentTarget);
this.displayHelpMessage("draw-poly-geometry-start-msg");
this.updateButtonText(this.layerType);
this.setEditingCursor();
this.isEditing = false;
},
Expand All @@ -309,11 +312,8 @@ module.exports = Backbone.View.extend({
this.workingGeometry.save();
this.resetWorkingGeometry();
this.setGeometryToolbarHighlighting(evt.currentTarget);
if (this.layerType === "Point") {
this.displayHelpMessage("edit-marker-geometry-msg");
} else {
this.displayHelpMessage("modify-geometry-msg");
}
this.displayHelpMessage("modify-geometry-msg");
this.updateButtonText(this.layerType);
this.setDefaultCursor();
this.hideIconToolbar();
this.hideColorpicker();
Expand Down Expand Up @@ -445,6 +445,22 @@ module.exports = Backbone.View.extend({
.addClass("hidden");
},

updateButtonText: function(type) {
console.log("type", type);

this.$el.find(".delete-geometry-" + type)
.removeClass("hidden")
.siblings()
.not("img")
.addClass("hidden");

this.$el.find(".edit-geometry-" + type)
.removeClass("hidden")
.siblings()
.not("img")
.addClass("hidden");
},

showIconToolbar: function() {
this.$el.find(".geometry-toolbar-icon-field")
.removeClass("hidden");
Expand Down

0 comments on commit 36a947c

Please sign in to comment.