Permalink
Browse files

Fixed background change error

  • Loading branch information...
tantaman committed Jul 3, 2012
1 parent ff11952 commit 40f0dccaabf61f29e229b019430ac01043d44b52
Showing with 42 additions and 39 deletions.
  1. +17 −17 client/src/main.coffee
  2. +3 −2 client/src/ui/editor/Editor.coffee
  3. +14 −14 client/web/scripts/main.js
  4. +8 −6 client/web/scripts/ui/editor/Editor.js
View
@@ -36,22 +36,6 @@ if not Function.bind? or Function.prototype.bind?
if window.location.href.indexOf("preview=true") isnt -1
# do nothing...
else
- requirejs(["vendor/amd/backbone",
- "state/DefaultState"],
- (Backbone, DefaultState) ->
- Backbone.sync = (method, model, options) ->
- if options.keyTrail?
- options.success(DefaultState.get(options.keyTrail))
-
- # slightly better than what we were doing before.
- # we need to roll the slide config up into the model.
- window.slideConfig =
- size:
- width: 1024
- height: 768
- continuation()
- )
-
continuation = () ->
requirejs(["ui/editor/Editor",
"model/presentation/Deck"],
@@ -66,4 +50,20 @@ else
$("body").append(editor.render())
deck.newSlide()
- )
+ )
+
+ requirejs(["vendor/amd/backbone",
+ "state/DefaultState"],
+ (Backbone, DefaultState) ->
+ Backbone.sync = (method, model, options) ->
+ if options.keyTrail?
+ options.success(DefaultState.get(options.keyTrail))
+
+ # slightly better than what we were doing before.
+ # we need to roll the slide config up into the model.
+ window.slideConfig =
+ size:
+ width: 1024
+ height: 768
+ continuation()
+ )
@@ -151,8 +151,9 @@ FileStorage, BackgroundPicker, AutoSaver, empty) ->
_backgroundChanged: (model, value) ->
# tell our perspectives about the bg update...
- for key,persp of @perspectives
- persp.backgroundChanged(value)
+ if value?
+ for key,persp of @perspectives
+ persp.backgroundChanged(value)
menuItemSelected: (e) ->
$target = $(e.currentTarget)
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 40f0dcc

Please sign in to comment.