summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor/WallpaperPicker.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-09-30 02:13:29 -0400
committerJules Laplace <jules@okfoc.us>2014-09-30 02:13:29 -0400
commit6ba3c656827c8e1fa84724c6b5dc2ba4f0991ffe (patch)
tree3959a14e110857ac2c88a344949f24fdb3fe42ca /public/assets/javascripts/ui/editor/WallpaperPicker.js
parenta8d3a30892687f58e3f18b768104ea54480cd465 (diff)
parent4a0717d5f8aa0ff3378ff589b106cd35c0586367 (diff)
merge
Diffstat (limited to 'public/assets/javascripts/ui/editor/WallpaperPicker.js')
-rw-r--r--public/assets/javascripts/ui/editor/WallpaperPicker.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/public/assets/javascripts/ui/editor/WallpaperPicker.js b/public/assets/javascripts/ui/editor/WallpaperPicker.js
index bcae3c5..0dd2921 100644
--- a/public/assets/javascripts/ui/editor/WallpaperPicker.js
+++ b/public/assets/javascripts/ui/editor/WallpaperPicker.js
@@ -13,6 +13,8 @@ var WallpaperPicker = UploadView.extend({
initialize: function(){
this.__super__.initialize.call(this)
this.$swatches = this.$(".swatches")
+ this.$remove = this.$(".wallpaperRemove")
+ this.$remove.hide()
},
loaded: false,
@@ -34,9 +36,10 @@ var WallpaperPicker = UploadView.extend({
},
populate: function(data){
- console.log(data)
this.loaded = true
- data && data.forEach(this.add.bind(this))
+ if (data && data.length) {
+ data.forEach(this.add.bind(this))
+ }
this.toggle(true)
},
@@ -46,6 +49,7 @@ var WallpaperPicker = UploadView.extend({
swatch.className = "swatch"
swatch.style.backgroundImage = "url(" + media.url + ")"
this.$swatches.append(swatch)
+ this.$swatches.show()
},
toggle: function (state) {
@@ -69,6 +73,7 @@ var WallpaperPicker = UploadView.extend({
pick: function(e){
var $swatch = $(e.currentTarget)
this.follow( e, $swatch.css('background-image') )
+ this.$remove.show()
},
remove: function(e){