summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor/WallpaperPicker.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-10-08 12:11:18 -0400
committerJules Laplace <jules@okfoc.us>2014-10-08 12:11:18 -0400
commit1f66850f5ec5a2e664ee8eaafbe25c46dad34102 (patch)
treebd320d7c4d92bf9ec6294d39989495b3e5b15939 /public/assets/javascripts/ui/editor/WallpaperPicker.js
parentc2e2334328256fa0409341692284f25f3167ab30 (diff)
generate masks for thumbnails
Diffstat (limited to 'public/assets/javascripts/ui/editor/WallpaperPicker.js')
-rw-r--r--public/assets/javascripts/ui/editor/WallpaperPicker.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/public/assets/javascripts/ui/editor/WallpaperPicker.js b/public/assets/javascripts/ui/editor/WallpaperPicker.js
index 140076d..6bf2542 100644
--- a/public/assets/javascripts/ui/editor/WallpaperPicker.js
+++ b/public/assets/javascripts/ui/editor/WallpaperPicker.js
@@ -133,7 +133,7 @@ var WallpaperPicker = UploadView.extend({
wall: null,
pickWall: function(wall){
- if (wall.background.src == "none") {
+ if (! wall.background || wall.background.src == "none") {
return;
}
this.wall = wall
@@ -148,16 +148,16 @@ var WallpaperPicker = UploadView.extend({
initializePositionCursor: function(){
var base = this
- var dx = 0, dy = 0, dragging = false
+ var dx = 0, dy = 0, dragging = false, delta
var x = 0, y = 0, s = 1
var mymouse = new mouse({
el: this.$position[0],
down: function(e, cursor){
if (! base.wall) return
+ dragging = true
s = parseFloat( base.$scale.val() )
x = base.wall.background.x
y = base.wall.background.y
- dragging = true
},
drag: function(e, cursor){
if (! dragging) return
@@ -172,7 +172,6 @@ var WallpaperPicker = UploadView.extend({
})
},
up: function(e, cursor, new_cursor){
- delta.zero()
dragging = false
},
})