summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-10-24 16:33:22 -0400
committerJules Laplace <jules@okfoc.us>2014-10-24 16:33:22 -0400
commit9bc2f0eec1bff31de427c97cbb190a4f7f74a483 (patch)
tree321ef8e5a700156fe46cc76ac480c717172d5879
parentee834da028053b18cf64b031022337fe78a717a3 (diff)
hide help when hovering the toolbar
-rw-r--r--public/assets/javascripts/ui/editor/EditorToolbar.js10
-rw-r--r--public/assets/javascripts/ui/editor/EditorView.js1
-rw-r--r--public/assets/javascripts/ui/editor/HelpCursor.js13
3 files changed, 18 insertions, 6 deletions
diff --git a/public/assets/javascripts/ui/editor/EditorToolbar.js b/public/assets/javascripts/ui/editor/EditorToolbar.js
index dceae3c..3c75b95 100644
--- a/public/assets/javascripts/ui/editor/EditorToolbar.js
+++ b/public/assets/javascripts/ui/editor/EditorToolbar.js
@@ -4,6 +4,8 @@ var EditorToolbar = View.extend({
events: {
"mousedown": 'stopPropagation',
+ "mouseenter": 'mouseenter',
+ "mouseleave": 'mouseleave',
"click [data-role='undo']": 'undo',
"click [data-role='toggle-map-view']": 'toggleMap',
"click [data-role='toggle-project-settings']": 'toggleSettings',
@@ -157,6 +159,14 @@ var EditorToolbar = View.extend({
this.toggleMap(false)
this.parent.presets.toggle(state)
},
+
+ mouseenter: function(){
+ this.parent.cursor.hide()
+ },
+
+ mouseleave: function(){
+ this.parent.cursor.show()
+ },
})
var editor = new function(){
diff --git a/public/assets/javascripts/ui/editor/EditorView.js b/public/assets/javascripts/ui/editor/EditorView.js
index 9946feb..2872ab9 100644
--- a/public/assets/javascripts/ui/editor/EditorView.js
+++ b/public/assets/javascripts/ui/editor/EditorView.js
@@ -47,6 +47,7 @@ var EditorView = View.extend({
readyLayout: function(data){
data.isNew = true
+ $('#help-button').trigger("click")
this.ready(data)
},
diff --git a/public/assets/javascripts/ui/editor/HelpCursor.js b/public/assets/javascripts/ui/editor/HelpCursor.js
index d0e1825..de0ca01 100644
--- a/public/assets/javascripts/ui/editor/HelpCursor.js
+++ b/public/assets/javascripts/ui/editor/HelpCursor.js
@@ -16,7 +16,7 @@ var HelpCursor = View.extend({
},
initialize: function(){
- $('#help-button').click(this.toggle.bind(this));
+ $('#help-button').click(this.toggle.bind(this))
},
toggle: function(){
@@ -28,10 +28,6 @@ var HelpCursor = View.extend({
this.active = true
this.message('start')
this.$el.show()
-// $('body').chardinJs('start')
-// $(window).one("click", function(){
-// $('body').chardinJs('stop')
-// })
this.move({ pageX: -1000, pageY: -10000 })
this.moveFn = this.move.bind(this)
document.addEventListener("mousemove", this.moveFn)
@@ -52,7 +48,12 @@ var HelpCursor = View.extend({
},
show: function(name){
- this.showMessage(name)
+ if (this.active) {
+ this.$el.show()
+ }
+ },
+ hide: function(){
+ this.$el.hide()
},
message: function(name){