diff options
| author | ryderr <r@okfoc.us> | 2014-10-16 15:28:42 -0400 |
|---|---|---|
| committer | ryderr <r@okfoc.us> | 2014-10-16 15:28:42 -0400 |
| commit | e25af0a7106c359faae2f73a7c2295ea93db8341 (patch) | |
| tree | e9ac0bc6690feb702dd5802a95f51481f7b3c878 /public/assets/javascripts/ui/editor/WallpaperPicker.js | |
| parent | a49396746de264667784f52b3f02c0089cd6fd5e (diff) | |
| parent | f8a4bb4609511393c92c618962f990673328d2f0 (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.js | 46 |
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); |
