From 9888e712a14cc2cf3af98c637f596bfe3cee2566 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 30 Sep 2014 18:05:14 -0400 Subject: esc cancels more things --- public/assets/javascripts/ui/editor/WallpaperPicker.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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 0dd2921..3756e88 100644 --- a/public/assets/javascripts/ui/editor/WallpaperPicker.js +++ b/public/assets/javascripts/ui/editor/WallpaperPicker.js @@ -97,11 +97,15 @@ var WallpaperPicker = UploadView.extend({ left: (e.pageX + 10) + 'px', }); } - $(window).on('mousemove', _followCursor) - $(window).one('click', function () { + function _hideCursor (e) { $(window).off('mousemove', _followCursor) + $(window).off('click', _hideCursor) + app.off('cancel-wallpaper', _hideCursor) $floatingSwatch.removeClass("scissors").hide() - }); + } + $(window).on('mousemove', _followCursor) + $(window).one('click', _hideCursor); + app.on('cancel-wallpaper', _hideCursor) $floatingSwatch.show() _followCursor(e); }) -- cgit v1.2.3-70-g09d2 From 937814eb04da00adde50cd1f2b658dd96d3550e5 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 1 Oct 2014 11:38:45 -0400 Subject: hide wallpaper tutorial message once wallpaper is uploaded --- public/assets/javascripts/ui/editor/WallpaperPicker.js | 16 ++++++++++++++-- public/assets/stylesheets/app.css | 4 +++- 2 files changed, 17 insertions(+), 3 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 3756e88..7f9b8f7 100644 --- a/public/assets/javascripts/ui/editor/WallpaperPicker.js +++ b/public/assets/javascripts/ui/editor/WallpaperPicker.js @@ -39,6 +39,10 @@ var WallpaperPicker = UploadView.extend({ this.loaded = true if (data && data.length) { data.forEach(this.add.bind(this)) + this.$(".txt").hide() + } + else { + this.$(".txt").show() } this.toggle(true) }, @@ -50,6 +54,7 @@ var WallpaperPicker = UploadView.extend({ swatch.style.backgroundImage = "url(" + media.url + ")" this.$swatches.append(swatch) this.$swatches.show() + this.$(".txt").hide() }, toggle: function (state) { @@ -71,14 +76,21 @@ var WallpaperPicker = UploadView.extend({ }, pick: function(e){ + app.tube('cancel-wallpaper') var $swatch = $(e.currentTarget) this.follow( e, $swatch.css('background-image') ) this.$remove.show() }, remove: function(e){ - this.follow( e, "none" ) - $(".floatingSwatch").addClass("scissors") + if (Scenery.nextWallpaper) { + Scenery.nextWallpaper = null + app.tube('cancel-wallpaper') + } + else { + this.follow( e, "none" ) + $(".floatingSwatch").addClass("scissors") + } }, follow: function(e, wallpaper, icon){ diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index 1446c60..9e65086 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -1209,6 +1209,7 @@ iframe.embed { float: none; } .wallpaper form { + position: relative; padding: 2px 0 0 0; font-size: 14px; font-weight: 300; @@ -1252,7 +1253,8 @@ iframe.embed { } .wallpaperUpload input[type="file"]{ position: absolute; - margin-top: -30px; + top: 0; + left: 0; background: blue; height: 28px; width: 100%; -- cgit v1.2.3-70-g09d2