summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor/WallpaperPicker.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-10-02 11:07:04 -0400
committerJules Laplace <jules@okfoc.us>2014-10-02 11:07:04 -0400
commitb1556ef6f9854e08f5bb20907c57a9558005af95 (patch)
treec772649ff6b235fbaa8809ff72daf917fce3857f /public/assets/javascripts/ui/editor/WallpaperPicker.js
parent61bb2d3bf1929201f61599ea1dd99f82e521878d (diff)
parentddac735a463278e245e566105ace3e32c723128c (diff)
merge
Diffstat (limited to 'public/assets/javascripts/ui/editor/WallpaperPicker.js')
-rw-r--r--public/assets/javascripts/ui/editor/WallpaperPicker.js26
1 files changed, 21 insertions, 5 deletions
diff --git a/public/assets/javascripts/ui/editor/WallpaperPicker.js b/public/assets/javascripts/ui/editor/WallpaperPicker.js
index 0dd2921..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){
@@ -97,11 +109,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);
})