diff options
Diffstat (limited to 'js/controllers')
-rw-r--r-- | js/controllers/objects-controller.js | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js new file mode 100644 index 00000000..543aa96f --- /dev/null +++ b/js/controllers/objects-controller.js | |||
@@ -0,0 +1,53 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage/core/core").Montage, | ||
8 | Component = require("montage/ui/component").Component; | ||
9 | |||
10 | var objectsController = exports.ObjectsController = Montage.create(Component, { | ||
11 | objects : { | ||
12 | value: [] | ||
13 | }, | ||
14 | |||
15 | handleAppLoaded : { | ||
16 | value: function() { | ||
17 | ///// Bind app's activeDocument property to | ||
18 | ///// objects controller's _activeDocument property | ||
19 | } | ||
20 | }, | ||
21 | |||
22 | deserializedFromTemplate : { | ||
23 | value: function() { | ||
24 | this.eventManager.addEventListener( "appLoaded", this, false); | ||
25 | }, | ||
26 | enumerable : false | ||
27 | }, | ||
28 | |||
29 | _activeDocument : { | ||
30 | value : null, | ||
31 | enumerable : false | ||
32 | }, | ||
33 | |||
34 | activeDocument : { | ||
35 | get : function() { | ||
36 | return this._activeDocument; | ||
37 | }, | ||
38 | set : function(document) { | ||
39 | ///// If the document is null set default stylesheets to null | ||
40 | if(!document) { return false; } | ||
41 | |||
42 | setTimeout(function() { | ||
43 | this.objects = document._document.application._template._deserializer.getObjectsFromLastDeserialization(); | ||
44 | }.bind(this), 1000); | ||
45 | |||
46 | |||
47 | ///// setting document via binding | ||
48 | this._activeDocument = document; | ||
49 | }, | ||
50 | enumerable : false | ||
51 | } | ||
52 | |||
53 | }); \ No newline at end of file | ||