summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-10-27 11:47:06 -0400
committerJules Laplace <jules@okfoc.us>2014-10-27 11:47:06 -0400
commit7a64a9fef46ddd1180dfa00fddd363b7814e381d (patch)
treea0090b68b81652f7915db5ee52d4540bf3d97c81 /public
parent30acfabe90d189e067949b0a806682eb5b3ef3a6 (diff)
hide preset underline if u modify something
Diffstat (limited to 'public')
-rw-r--r--public/assets/javascripts/ui/editor/ColorControl.js1
-rw-r--r--public/assets/javascripts/ui/editor/Presets.js9
-rw-r--r--public/assets/javascripts/ui/editor/WallpaperPicker.js3
3 files changed, 8 insertions, 5 deletions
diff --git a/public/assets/javascripts/ui/editor/ColorControl.js b/public/assets/javascripts/ui/editor/ColorControl.js
index 459ac1e..72e9fb1 100644
--- a/public/assets/javascripts/ui/editor/ColorControl.js
+++ b/public/assets/javascripts/ui/editor/ColorControl.js
@@ -92,6 +92,7 @@ var ColorControl = View.extend({
this.setSwatchColor(this.mode, rgb)
// console.log(rgb)
Walls.setColor[ this.mode ](rgb)
+ this.parent.presets.modified = true
},
setSwatchColor: function(mode, rgb) {
diff --git a/public/assets/javascripts/ui/editor/Presets.js b/public/assets/javascripts/ui/editor/Presets.js
index d233144..ac77d6b 100644
--- a/public/assets/javascripts/ui/editor/Presets.js
+++ b/public/assets/javascripts/ui/editor/Presets.js
@@ -34,7 +34,7 @@ var Presets = View.extend({
ceiling: [0,0,0],
},
matrix: {
- wall: { src: "http://dump.fm/images/20130225/1361818675427-dumpfm-melipone-matrixremixtransfast.gif", scale: 4.0, color: [0,0,0] },
+ wall: { src: "http://dumpfm.s3.amazonaws.com/images/20130225/1361818675427-dumpfm-melipone-matrixremixtransfast.gif", scale: 4.0, color: [0,0,0] },
outline: [0,0,0],
floor: [10,15,10],
ceiling: [0,0,0],
@@ -53,9 +53,13 @@ var Presets = View.extend({
}.bind(this))
},
+ modified: false,
toggle: function(state){
this.$el.toggleClass("active", state)
this.parent.cursor.message(state ? "presets" : "start")
+ if (this.modified) {
+ this.$(".active").removeClass('active')
+ }
},
show: function(){
@@ -72,6 +76,7 @@ var Presets = View.extend({
this.$(".active").removeClass('active')
$(e.currentTarget).addClass('active')
this.load(this.presets[preset])
+ this.modified = false
},
selectColor: function(e){
@@ -79,7 +84,6 @@ var Presets = View.extend({
console.log(preset)
},
- lastPreset: {wall:[1],outline:[1],floor:[1],ceiling:[1]},
load: function(preset){
this.parent.colorControl.modes.forEach(function(mode){
var color
@@ -96,7 +100,6 @@ var Presets = View.extend({
}.bind(this))
this.parent.colorControl.setMode(preset.wall.color ? "wall" : "floor")
Walls.setBodyColor()
- this.lastPreset = preset
},
}) \ No newline at end of file
diff --git a/public/assets/javascripts/ui/editor/WallpaperPicker.js b/public/assets/javascripts/ui/editor/WallpaperPicker.js
index 2d60f11..d7d666c 100644
--- a/public/assets/javascripts/ui/editor/WallpaperPicker.js
+++ b/public/assets/javascripts/ui/editor/WallpaperPicker.js
@@ -21,7 +21,6 @@ var WallpaperPicker = UploadView.extend({
this.__super__.initialize.call(this)
this.$swatches = this.$(".swatches")
this.$remove = this.$(".wallpaperRemove")
- this.$remove.hide()
this.$url = this.$(".url")
@@ -108,7 +107,7 @@ var WallpaperPicker = UploadView.extend({
app.tube('cancel-wallpaper')
var $swatch = $(e.currentTarget)
this.follow( e, $swatch.css('background-image') )
- this.$remove.show()
+ this.parent.presets.modified = true
},
remove: function(e){