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 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'public/assets/javascripts') 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){ -- cgit v1.2.3-70-g09d2