Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed background change error

  • Loading branch information...
commit 40f0dccaabf61f29e229b019430ac01043d44b52 1 parent ff11952
@tantaman authored
View
34 client/src/main.coffee
@@ -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()
+ )
View
5 client/src/ui/editor/Editor.coffee
@@ -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
28 client/web/scripts/main.js
@@ -51,20 +51,6 @@ if (!(Function.bind != null) || (Function.prototype.bind != null)) {
if (window.location.href.indexOf("preview=true") !== -1) {
} else {
- requirejs(["vendor/amd/backbone", "state/DefaultState"], function(Backbone, DefaultState) {
- Backbone.sync = function(method, model, options) {
- if (options.keyTrail != null) {
- return options.success(DefaultState.get(options.keyTrail));
- }
- };
- window.slideConfig = {
- size: {
- width: 1024,
- height: 768
- }
- };
- return continuation();
- });
continuation = function() {
return requirejs(["ui/editor/Editor", "model/presentation/Deck"], function(Editor, Deck) {
var deck, editor;
@@ -82,4 +68,18 @@ if (window.location.href.indexOf("preview=true") !== -1) {
return deck.newSlide();
});
};
+ requirejs(["vendor/amd/backbone", "state/DefaultState"], function(Backbone, DefaultState) {
+ Backbone.sync = function(method, model, options) {
+ if (options.keyTrail != null) {
+ return options.success(DefaultState.get(options.keyTrail));
+ }
+ };
+ window.slideConfig = {
+ size: {
+ width: 1024,
+ height: 768
+ }
+ };
+ return continuation();
+ });
}
View
14 client/web/scripts/ui/editor/Editor.js
@@ -168,13 +168,15 @@ define(["vendor/amd/backbone", "./SlideEditor", "./transition_editor/TransitionE
},
_backgroundChanged: function(model, value) {
var key, persp, _ref, _results;
- _ref = this.perspectives;
- _results = [];
- for (key in _ref) {
- persp = _ref[key];
- _results.push(persp.backgroundChanged(value));
+ if (value != null) {
+ _ref = this.perspectives;
+ _results = [];
+ for (key in _ref) {
+ persp = _ref[key];
+ _results.push(persp.backgroundChanged(value));
+ }
+ return _results;
}
- return _results;
},
menuItemSelected: function(e) {
var $target, option;
Please sign in to comment.
Something went wrong with that request. Please try again.