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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 // service. Otherwise the relations data will not be available. | 628 // service. Otherwise the relations data will not be available. |
629 var service = this.db.services.getById(unit.service); | 629 var service = this.db.services.getById(unit.service); |
630 this._prefetch_service(service); | 630 this._prefetch_service(service); |
631 } | 631 } |
632 this.showView( | 632 this.showView( |
633 'unit', | 633 'unit', |
634 // The querystring is used to handle highlighting relation rows in | 634 // The querystring is used to handle highlighting relation rows in |
635 // links from notifications about errors. | 635 // links from notifications about errors. |
636 { getModelURL: Y.bind(this.getModelURL, this), | 636 { getModelURL: Y.bind(this.getModelURL, this), |
637 unit: unit, db: this.db, env: this.env, | 637 unit: unit, db: this.db, env: this.env, |
638 querystring: req.query }); | 638 querystring: req.query, |
| 639 landscape: this.landscape }); |
639 }, | 640 }, |
640 | 641 |
641 /** | 642 /** |
642 * @method _prefetch_service | 643 * @method _prefetch_service |
643 * @private | 644 * @private |
644 */ | 645 */ |
645 _prefetch_service: function(service) { | 646 _prefetch_service: function(service) { |
646 // Only prefetch once. We redispatch to the service view | 647 // Only prefetch once. We redispatch to the service view |
647 // after we have status. | 648 // after we have status. |
648 if (!service || service.get('prefetch')) { return; } | 649 if (!service || service.get('prefetch')) { return; } |
(...skipping 20 matching lines...) Expand all Loading... |
669 * @method _buildServiceView | 670 * @method _buildServiceView |
670 * @private | 671 * @private |
671 */ | 672 */ |
672 _buildServiceView: function(req, viewName) { | 673 _buildServiceView: function(req, viewName) { |
673 var service = this.db.services.getById(req.params.id); | 674 var service = this.db.services.getById(req.params.id); |
674 this._prefetch_service(service); | 675 this._prefetch_service(service); |
675 this.showView(viewName, { | 676 this.showView(viewName, { |
676 model: service, | 677 model: service, |
677 db: this.db, | 678 db: this.db, |
678 env: this.env, | 679 env: this.env, |
| 680 landscape: this.landscape, |
679 getModelURL: Y.bind(this.getModelURL, this), | 681 getModelURL: Y.bind(this.getModelURL, this), |
680 querystring: req.query | 682 querystring: req.query |
681 }, {}, function(view) { | 683 }, {}, function(view) { |
682 // If the view contains a method call fitToWindow, | 684 // If the view contains a method call fitToWindow, |
683 // we will execute it after getting the view rendered. | 685 // we will execute it after getting the view rendered. |
684 if (view.fitToWindow) { | 686 if (view.fitToWindow) { |
685 view.fitToWindow(); | 687 view.fitToWindow(); |
686 } | 688 } |
687 }); | 689 }); |
688 }, | 690 }, |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 'io', | 1210 'io', |
1209 'json-parse', | 1211 'json-parse', |
1210 'app-base', | 1212 'app-base', |
1211 'app-transitions', | 1213 'app-transitions', |
1212 'base', | 1214 'base', |
1213 'node', | 1215 'node', |
1214 'model', | 1216 'model', |
1215 'app-subapp-extension', | 1217 'app-subapp-extension', |
1216 'sub-app'] | 1218 'sub-app'] |
1217 }); | 1219 }); |
OLD | NEW |