summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor/WallpaperPicker.js
diff options
context:
space:
mode:
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
},
})