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.js46
1 files changed, 20 insertions, 26 deletions
diff --git a/public/assets/javascripts/ui/editor/WallpaperPicker.js b/public/assets/javascripts/ui/editor/WallpaperPicker.js
index 6bcd859..afdfca7 100644
--- a/public/assets/javascripts/ui/editor/WallpaperPicker.js
+++ b/public/assets/javascripts/ui/editor/WallpaperPicker.js
@@ -28,19 +28,28 @@ var WallpaperPicker = UploadView.extend({
loaded: false,
show: function(){
- if (! this.loaded) {
- this.parent.cursor.message("wallpaper")
- this.load()
- }
- else {
- this.toggle(true)
- }
+ this.toggle(true)
},
-
hide: function(){
- this.__super__.hide.call(this)
+ this.toggle(false)
},
-
+// hide: function(){
+// this.__super__.hide.call(this)
+// },
+
+ toggle: function (state) {
+ app.tube('cancel-wallpaper')
+ this.$el.toggleClass("active", state)
+ if (state) {
+ this.parent.cursor.message("wallpaper")
+ if (! this.loaded) {
+ this.load()
+ }
+ }
+ // toggle the class that makes the cursor a paintbucket
+ // $("body").removeClass("pastePaper")
+ },
+
load: function(){
$.get("/api/media/user", { tag: this.mediaTag }, this.populate.bind(this))
},
@@ -86,21 +95,6 @@ var WallpaperPicker = UploadView.extend({
}.bind(this))
},
- toggle: function (state) {
- if (state && ! this.loaded) {
- this.show()
- }
- else {
- this.$el.toggleClass("active", state)
- }
- // toggle the class that makes the cursor a paintbucket
- // $("body").removeClass("pastePaper")
- },
-
- hide: function(){
- this.toggle(false)
- },
-
beforeUpload: function(){
},
@@ -145,7 +139,7 @@ var WallpaperPicker = UploadView.extend({
$floatingSwatch.removeClass("scissors").hide()
}
$(window).on('mousemove', _followCursor)
- $(window).one('click', _hideCursor);
+ // $(window).one('click', _hideCursor);
app.on('cancel-wallpaper', _hideCursor)
$floatingSwatch.show()
_followCursor(e);