From 36a947ccb7092576157b6893c55dd74dd8eb2903 Mon Sep 17 00:00:00 2001 From: goldpbear Date: Thu, 11 May 2017 21:15:37 -0700 Subject: [PATCH] update editor UI text --- .../jstemplates/place-form-field-types.html | 12 +++++++-- .../static/js/views/geometry-editor-view.js | 26 +++++++++++++++---- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/base/jstemplates/place-form-field-types.html b/src/base/jstemplates/place-form-field-types.html index 0ae0bc688d..9b150f25ba 100644 --- a/src/base/jstemplates/place-form-field-types.html +++ b/src/base/jstemplates/place-form-field-types.html @@ -182,8 +182,16 @@
diff --git a/src/base/static/js/views/geometry-editor-view.js b/src/base/static/js/views/geometry-editor-view.js index c36fedbb83..42f2375d56 100644 --- a/src/base/static/js/views/geometry-editor-view.js +++ b/src/base/static/js/views/geometry-editor-view.js @@ -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; @@ -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; }, @@ -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; }, @@ -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(); @@ -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");