diff options
| author | Julie Lala <jules@okfoc.us> | 2014-08-11 00:10:24 -0400 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2014-08-11 00:10:24 -0400 |
| commit | 02bde51c24ae1c6e189d031b80226e6a9f7cbc59 (patch) | |
| tree | a64f5a040787b0b513c20ab8582aea171184736e /public/assets/javascripts/ui/editor | |
| parent | 04c2c21ad2ed872137b7a7e633d6bebcd7b04b61 (diff) | |
| parent | 9cd88d59e45b530e483490804503e6b47030fd4d (diff) | |
merge master
Diffstat (limited to 'public/assets/javascripts/ui/editor')
4 files changed, 30 insertions, 7 deletions
diff --git a/public/assets/javascripts/ui/editor/EditorSettings.js b/public/assets/javascripts/ui/editor/EditorSettings.js index 13a6f60..d6a79fb 100644 --- a/public/assets/javascripts/ui/editor/EditorSettings.js +++ b/public/assets/javascripts/ui/editor/EditorSettings.js @@ -130,7 +130,7 @@ var EditorSettings = FormView.extend({ this.$name.val(data.name) this.action = this.updateAction - window.history.pushState(null, document.title, "/project/" + data.slug) + window.history.pushState(null, document.title, "/project/" + data.slug + "/edit") }, }) diff --git a/public/assets/javascripts/ui/editor/EditorToolbar.js b/public/assets/javascripts/ui/editor/EditorToolbar.js index a3abc5a..5e0da7e 100644 --- a/public/assets/javascripts/ui/editor/EditorToolbar.js +++ b/public/assets/javascripts/ui/editor/EditorToolbar.js @@ -30,6 +30,7 @@ var EditorToolbar = View.extend({ this.parent.mediaViewer.show() this.parent.mediaUpload.show() this.resetMode() + this.resetControls() }, resetMode: function(){ @@ -43,6 +44,7 @@ var EditorToolbar = View.extend({ }, resizeMedia: function(e, state){ + this.resetControls() if (! state && typeof e == "boolean") { state = e editor.permissions.assign("resize", state) @@ -59,6 +61,7 @@ var EditorToolbar = View.extend({ }, destroyMedia: function(e, state){ + this.resetControls() if (! state && typeof e == "boolean") { state = e editor.permissions.assign("destroy", state) @@ -73,11 +76,19 @@ var EditorToolbar = View.extend({ }, toggleWallpaper: function(){ - this.parent.wallpaperPicker.toggle() + var state = ! $("[data-role='toggle-wallpaper-panel']").hasClass("inuse") + this.resetMode() + $("[data-role='toggle-wallpaper-panel']").toggleClass("inuse", state) + this.parent.lightControl.hide() + this.parent.wallpaperPicker.toggle(state) }, toggleLightControl: function(){ - this.parent.lightControl.toggle() + var state = ! $("[data-role='toggle-light-control']").hasClass("inuse") + this.resetMode() + $("[data-role='toggle-light-control']").toggleClass("inuse", state) + this.parent.wallpaperPicker.hide() + this.parent.lightControl.toggle(state) }, editWallText: function(){ diff --git a/public/assets/javascripts/ui/editor/LightControl.js b/public/assets/javascripts/ui/editor/LightControl.js index 93d97ed..c3e80c2 100644 --- a/public/assets/javascripts/ui/editor/LightControl.js +++ b/public/assets/javascripts/ui/editor/LightControl.js @@ -6,12 +6,18 @@ var LightControl = View.extend({ "mousedown": "stopPropagation", }, - toggle: function(){ - this.$el.toggleClass("active"); + toggle: function(state){ + this.$el.toggleClass("active", state); // toggle the class that makes the cursor a paintbucket // $("body").removeClass("pastePaper"); }, + show: function(){ + this.toggle(true) + }, + hide: function(){ + this.toggle(false) + }, /* $("#shadow-control").on({ diff --git a/public/assets/javascripts/ui/editor/WallpaperPicker.js b/public/assets/javascripts/ui/editor/WallpaperPicker.js index cb1e361..9ee441b 100644 --- a/public/assets/javascripts/ui/editor/WallpaperPicker.js +++ b/public/assets/javascripts/ui/editor/WallpaperPicker.js @@ -23,11 +23,17 @@ var WallpaperPicker = View.extend({ wm.init() }, - toggle: function(){ - this.$el.toggleClass("active"); + toggle: function(state){ + this.$el.toggleClass("active", state); // toggle the class that makes the cursor a paintbucket // $("body").removeClass("pastePaper"); }, + show: function(){ + this.toggle(true) + }, + hide: function(){ + this.toggle(false) + }, pick: function(e){ var $swatch = $(e.currentTarget) |
