From f8a4bb4609511393c92c618962f990673328d2f0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 16 Oct 2014 14:31:13 -0400 Subject: cursor stuff, hit esc to exit wallpaper mode --- .../javascripts/ui/editor/WallpaperPicker.js | 46 ++++++++++------------ 1 file changed, 20 insertions(+), 26 deletions(-) (limited to 'public/assets/javascripts/ui/editor/WallpaperPicker.js') diff --git a/public/assets/javascripts/ui/editor/WallpaperPicker.js b/public/assets/javascripts/ui/editor/WallpaperPicker.js index 6bcd859..afdfca7 100644 --- a/public/assets/javascripts/ui/editor/WallpaperPicker.js +++ b/public/assets/javascripts/ui/editor/WallpaperPicker.js @@ -28,19 +28,28 @@ var WallpaperPicker = UploadView.extend({ loaded: false, show: function(){ - if (! this.loaded) { - this.parent.cursor.message("wallpaper") - this.load() - } - else { - this.toggle(true) - } + this.toggle(true) }, - hide: function(){ - this.__super__.hide.call(this) + this.toggle(false) }, - +// hide: function(){ +// this.__super__.hide.call(this) +// }, + + toggle: function (state) { + app.tube('cancel-wallpaper') + this.$el.toggleClass("active", state) + if (state) { + this.parent.cursor.message("wallpaper") + if (! this.loaded) { + this.load() + } + } + // toggle the class that makes the cursor a paintbucket + // $("body").removeClass("pastePaper") + }, + load: function(){ $.get("/api/media/user", { tag: this.mediaTag }, this.populate.bind(this)) }, @@ -86,21 +95,6 @@ var WallpaperPicker = UploadView.extend({ }.bind(this)) }, - toggle: function (state) { - if (state && ! this.loaded) { - this.show() - } - else { - this.$el.toggleClass("active", state) - } - // toggle the class that makes the cursor a paintbucket - // $("body").removeClass("pastePaper") - }, - - hide: function(){ - this.toggle(false) - }, - beforeUpload: function(){ }, @@ -145,7 +139,7 @@ var WallpaperPicker = UploadView.extend({ $floatingSwatch.removeClass("scissors").hide() } $(window).on('mousemove', _followCursor) - $(window).one('click', _hideCursor); + // $(window).one('click', _hideCursor); app.on('cancel-wallpaper', _hideCursor) $floatingSwatch.show() _followCursor(e); -- cgit v1.2.3-70-g09d2