summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor/WallpaperPicker.js
diff options
context:
space:
mode:
authorryderr <r@okfoc.us>2014-10-08 13:29:10 -0400
committerryderr <r@okfoc.us>2014-10-08 13:29:10 -0400
commitafc4df0710709aab596e29e52d067d50fc5f6b87 (patch)
tree63d7ed791138134bc7cd2823293d97b3198f8bea /public/assets/javascripts/ui/editor/WallpaperPicker.js
parent88f0fe47a3f130efc25ee9e2579427c814667086 (diff)
parent6f4cd32fa13efe3b0e8b26183589f66889dd3738 (diff)
Merge branch 'master' of github.com:okfocus/vvalls
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
},
})