HPCCPlatformMainWidget.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*##############################################################################
  2. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################## */
  16. define([
  17. "dojo/_base/declare",
  18. "dijit/_TemplatedMixin",
  19. "dijit/_WidgetsInTemplateMixin",
  20. "dijit/registry",
  21. "hpcc/_TabContainerWidget",
  22. "dojo/text!../templates/HPCCPlatformMainWidget.html",
  23. "dijit/layout/BorderContainer",
  24. "dijit/layout/TabContainer",
  25. "dijit/layout/ContentPane",
  26. "hpcc/ActivityWidget",
  27. "hpcc/SearchResultsWidget"
  28. ], function (declare,
  29. _TemplatedMixin, _WidgetsInTemplateMixin, registry,
  30. _TabContainerWidget,
  31. template) {
  32. return declare("HPCCPlatformMainWidget", [_TabContainerWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
  33. templateString: template,
  34. baseClass: "HPCCPlatformMainWidget",
  35. postCreate: function (args) {
  36. this.inherited(arguments);
  37. },
  38. startup: function (args) {
  39. this.inherited(arguments);
  40. },
  41. // Hitched actions ---
  42. // Implementation ---
  43. init: function (params) {
  44. if (this.initalized)
  45. return;
  46. this.initalized = true;
  47. this.initTab();
  48. },
  49. initTab: function () {
  50. var currSel = this.getSelectedChild();
  51. if (currSel && !currSel.initalized) {
  52. if (currSel.init) {
  53. currSel.init(currSel.params);
  54. }
  55. }
  56. }
  57. });
  58. });