Left: | ||
Right: |
OLD | NEW |
---|---|
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 var spinner; | 3 var spinner; |
4 | 4 |
5 /** | 5 /** |
6 * Provide the main App class, based on the YUI App framework. Also provide | 6 * Provide the main App class, based on the YUI App framework. Also provide |
7 * the routing definitions, which map the request paths to the top-level | 7 * the routing definitions, which map the request paths to the top-level |
8 * views defined by the App class. | 8 * views defined by the App class. |
9 * | 9 * |
10 * @module app | 10 * @module app |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
614 // service. Otherwise the relations data will not be available. | 614 // service. Otherwise the relations data will not be available. |
615 var service = this.db.services.getById(unit.service); | 615 var service = this.db.services.getById(unit.service); |
616 this._prefetch_service(service); | 616 this._prefetch_service(service); |
617 } | 617 } |
618 this.showView( | 618 this.showView( |
619 'unit', | 619 'unit', |
620 // The querystring is used to handle highlighting relation rows in | 620 // The querystring is used to handle highlighting relation rows in |
621 // links from notifications about errors. | 621 // links from notifications about errors. |
622 { getModelURL: Y.bind(this.getModelURL, this), | 622 { getModelURL: Y.bind(this.getModelURL, this), |
623 unit: unit, db: this.db, env: this.env, | 623 unit: unit, db: this.db, env: this.env, |
624 querystring: req.query }); | 624 querystring: req.query, landscape: this.landscape }); |
bcsaller
2013/02/28 15:21:26
nitpick Maybe its own line.
matthew.scott
2013/02/28 18:16:47
Done.
| |
625 }, | 625 }, |
626 | 626 |
627 /** | 627 /** |
628 * @method _prefetch_service | 628 * @method _prefetch_service |
629 * @private | 629 * @private |
630 */ | 630 */ |
631 _prefetch_service: function(service) { | 631 _prefetch_service: function(service) { |
632 // Only prefetch once. We redispatch to the service view | 632 // Only prefetch once. We redispatch to the service view |
633 // after we have status. | 633 // after we have status. |
634 if (!service || service.get('prefetch')) { return; } | 634 if (!service || service.get('prefetch')) { return; } |
(...skipping 20 matching lines...) Expand all Loading... | |
655 * @method _buildServiceView | 655 * @method _buildServiceView |
656 * @private | 656 * @private |
657 */ | 657 */ |
658 _buildServiceView: function(req, viewName) { | 658 _buildServiceView: function(req, viewName) { |
659 var service = this.db.services.getById(req.params.id); | 659 var service = this.db.services.getById(req.params.id); |
660 this._prefetch_service(service); | 660 this._prefetch_service(service); |
661 this.showView(viewName, { | 661 this.showView(viewName, { |
662 model: service, | 662 model: service, |
663 db: this.db, | 663 db: this.db, |
664 env: this.env, | 664 env: this.env, |
665 landscape: this.landscape, | |
665 getModelURL: Y.bind(this.getModelURL, this), | 666 getModelURL: Y.bind(this.getModelURL, this), |
666 querystring: req.query | 667 querystring: req.query |
667 }, {}, function(view) { | 668 }, {}, function(view) { |
668 // If the view contains a method call fitToWindow, | 669 // If the view contains a method call fitToWindow, |
669 // we will execute it after getting the view rendered. | 670 // we will execute it after getting the view rendered. |
670 if (view.fitToWindow) { | 671 if (view.fitToWindow) { |
671 view.fitToWindow(); | 672 view.fitToWindow(); |
672 } | 673 } |
673 }); | 674 }); |
674 }, | 675 }, |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1190 'juju-landscape', | 1191 'juju-landscape', |
1191 'io', | 1192 'io', |
1192 'json-parse', | 1193 'json-parse', |
1193 'app-base', | 1194 'app-base', |
1194 'app-transitions', | 1195 'app-transitions', |
1195 'base', | 1196 'base', |
1196 'node', | 1197 'node', |
1197 'model', | 1198 'model', |
1198 'sub-app'] | 1199 'sub-app'] |
1199 }); | 1200 }); |
OLD | NEW |