diff options
author | Valerio Virgillito | 2012-05-17 12:25:37 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-17 12:25:37 -0700 |
commit | 342c97ac9b727b22a7b0bfefca4d2a168bc3055b (patch) | |
tree | 7909b8cbe077d988293d989d7eb3e6df58fb1710 /js/document/templates/html/main.js | |
parent | bac01dd8771d91dc227c970b3d29e72d8f079692 (diff) | |
parent | e713d437a3918b9e417d1a0bc9f11275fc9e6634 (diff) | |
download | ninja-342c97ac9b727b22a7b0bfefca4d2a168bc3055b.tar.gz |
Merge pull request #244 from joseeight/Document
Cleaning up files for templates
Diffstat (limited to 'js/document/templates/html/main.js')
-rw-r--r-- | js/document/templates/html/main.js | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/js/document/templates/html/main.js b/js/document/templates/html/main.js deleted file mode 100644 index ffa3fab2..00000000 --- a/js/document/templates/html/main.js +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
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 | var Montage = require("montage/core/core").Montage, | ||
7 | Component = require("montage/ui/component").Component, | ||
8 | Template = require("montage/ui/template").Template, | ||
9 | TemplateCreator = require("tools/template/template-creator").TemplateCreator; | ||
10 | |||
11 | exports.Main = Montage.create(Component, { | ||
12 | |||
13 | hasTemplate: { | ||
14 | value: false | ||
15 | }, | ||
16 | |||
17 | /** | ||
18 | * Adding window hooks to callback into this object from Ninja. | ||
19 | */ | ||
20 | templateDidLoad: { | ||
21 | value: function(){ | ||
22 | var self = this; | ||
23 | // | ||
24 | window.addComponent = function(element, data, callback) { | ||
25 | var component; | ||
26 | |||
27 | component = require.async(data.path) | ||
28 | .then(function(component) { | ||
29 | var componentRequire = component[data.name]; | ||
30 | var componentInstance = componentRequire.create(); | ||
31 | |||
32 | componentInstance.element = element; | ||
33 | |||
34 | componentInstance.needsDraw = true; | ||
35 | componentInstance.ownerComponent = self; | ||
36 | |||
37 | callback(componentInstance, element); | ||
38 | }) | ||
39 | .end(); | ||
40 | |||
41 | }; | ||
42 | // | ||
43 | window.mjsTemplateCreator = TemplateCreator; | ||
44 | // | ||
45 | window.mjsTemplate = Template; | ||
46 | |||
47 | |||
48 | // Dispatch event when this template has loaded. | ||
49 | /* | ||
50 | var newEvent = document.createEvent( "CustomEvent" ); | ||
51 | newEvent.initCustomEvent( "userTemplateDidLoad", false, true ); | ||
52 | document.body.dispatchEvent( newEvent ); | ||
53 | */ | ||
54 | |||
55 | } | ||
56 | } | ||
57 | }); \ No newline at end of file | ||