Main.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. MWF.xApplication.Attendance = MWF.xApplication.Attendance || {};
  2. MWF.require("MWF.widget.O2Identity", null, false);
  3. //MWF.xDesktop.requireApp("Attendance", "Actions.RestActions", null, false);
  4. MWF.xDesktop.requireApp("Attendance", "Common", null, false);
  5. MWF.xDesktop.requireApp("Template", "MDomItem", null, false);
  6. MWF.xApplication.Attendance.options = {
  7. multitask: false,
  8. executable: true
  9. };
  10. MWF.xApplication.Attendance.Main = new Class({
  11. Extends: MWF.xApplication.Common.Main,
  12. Implements: [Options, Events],
  13. options: {
  14. "curNaviId": null,
  15. "style": "default",
  16. "name": "Attendance",
  17. "icon": "icon.png",
  18. "width": "1400",
  19. "height": "700",
  20. "isResize": true,
  21. "isMax": true,
  22. "title": MWF.xApplication.Attendance.LP.title
  23. },
  24. onQueryLoad: function () {
  25. this.lp = MWF.xApplication.Attendance.LP;
  26. },
  27. loadApplication: function (callback) {
  28. if (!this.options.isRefresh) {
  29. this.maxSize(function () {
  30. this.loadLayout();
  31. }.bind(this));
  32. } else {
  33. this.loadLayout();
  34. }
  35. },
  36. loadLayout: function () {
  37. this.manageUnits = [];
  38. this.manageTopUnits = [];
  39. this.enableType = "";
  40. this.restActions = MWF.Actions.get("x_attendance_assemble_control");
  41. this.personActions = MWF.Actions.get("x_organization_assemble_personal");
  42. this.orgActions = MWF.Actions.get("x_organization_assemble_express");
  43. this.createNode();
  44. this.loadApplicationContent();
  45. },
  46. isAdmin: function () {
  47. return this.isTopUnitManager() || MWF.AC.isAttendanceManager() || MWF.AC.isAdministrator()
  48. },
  49. isUnitManager: function () {
  50. return this.manageUnits.length > 0;
  51. },
  52. isTopUnitManager: function () {
  53. return this.manageTopUnits.length > 0;
  54. },
  55. getNameFlag: function (name) {
  56. var t = typeOf(name);
  57. if (t === "array") {
  58. var v = [];
  59. name.each(function (id) {
  60. v.push((typeOf(id) === "object") ? (id.distinguishedName || id.id || id.unique || id.name) : id);
  61. });
  62. return v;
  63. } else {
  64. return [(t === "object") ? (name.distinguishedName || name.id || name.unique || name.name) : name];
  65. }
  66. },
  67. loadController: function (callback) {
  68. this.restActions.listPermission(function (json) {
  69. json.data = json.data || [];
  70. json.data.each(function (item) {
  71. if (item.adminLevel == "COMPANY" && item.adminName == layout.desktop.session.user.distinguishedName) {
  72. this.manageTopUnits.push(item.unitName)
  73. } else if (item.adminLevel == "DEPT" && item.adminName == layout.desktop.session.user.distinguishedName) {
  74. this.manageUnits.push(item.unitName)
  75. }
  76. }.bind(this));
  77. if (callback) callback(json);
  78. }.bind(this));
  79. },
  80. loadEnableType: function (callback) {
  81. var action = o2.Actions.load("x_attendance_assemble_control");
  82. action.AttendanceSettingAction.enableType(//平台封装好的方法
  83. function (json) { //服务调用成功的回调函数, json为服务传回的数据
  84. if (json.data && json.data.value) {
  85. debugger;
  86. this.enableType = json.data.value;
  87. }
  88. if (callback) callback(json);
  89. }.bind(this));
  90. },
  91. createNode: function () {
  92. this.content.setStyle("overflow", "hidden");
  93. this.node = new Element("div", {
  94. "styles": { "width": "100%", "height": "100%", "overflow": "hidden" }
  95. }).inject(this.content);
  96. },
  97. loadApplicationContent: function () {
  98. this.loadController(function () {
  99. this.loadEnableType(function () {
  100. this.loaNavi();
  101. }.bind(this));
  102. }.bind(this));
  103. //this.loadApplicationLayout();
  104. },
  105. loaNavi: function (callback) {
  106. this.naviNode = new Element("div.naviNode", {
  107. "styles": this.css.naviNode
  108. }).inject(this.node);
  109. var curNavi = { "id": "" };
  110. if (this.status) {
  111. curNavi.id = this.status.id
  112. }
  113. if (this.options.curNaviId) {
  114. curNavi.id = this.options.curNaviId;
  115. }
  116. this.navi = new MWF.xApplication.Attendance.Navi(this, this.naviNode, curNavi);
  117. },
  118. clearContent: function () {
  119. if (this.explorerContent) {
  120. if (this.explorer && this.explorer.destroy) {
  121. this.explorer.destroy();
  122. }
  123. this.explorerContent.destroy();
  124. this.explorerContent = null;
  125. }
  126. },
  127. openMyIndex: function () {
  128. MWF.xDesktop.requireApp("Attendance", "MyIndex", function () {
  129. this.clearContent();
  130. this.explorerContent = new Element("div", {
  131. "styles": this.css.rightContentNode
  132. }).inject(this.node);
  133. this.explorer = new MWF.xApplication.Attendance.MyIndex(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  134. this.explorer.load();
  135. }.bind(this));
  136. },
  137. openMyDetail: function () {
  138. MWF.xDesktop.requireApp("Attendance", "MyDetail", function () {
  139. this.clearContent();
  140. this.explorerContent = new Element("div", {
  141. "styles": this.css.rightContentNode
  142. }).inject(this.node);
  143. this.explorer = new MWF.xApplication.Attendance.MyDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  144. this.explorer.load();
  145. }.bind(this));
  146. },
  147. openUnitIndex: function () {
  148. MWF.xDesktop.requireApp("Attendance", "UnitIndex", function () {
  149. this.clearContent();
  150. this.explorerContent = new Element("div", {
  151. "styles": this.css.rightContentNode
  152. }).inject(this.node);
  153. this.explorer = new MWF.xApplication.Attendance.UnitIndex(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  154. this.explorer.load();
  155. }.bind(this));
  156. },
  157. openUnitDingdingIndex: function () {
  158. MWF.xDesktop.requireApp("Attendance", "UnitDingdingIndex", function () {
  159. this.clearContent();
  160. this.explorerContent = new Element("div", {
  161. "styles": this.css.rightContentNode
  162. }).inject(this.node);
  163. this.explorer = new MWF.xApplication.Attendance.UnitDingdingIndex(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  164. this.explorer.load();
  165. }.bind(this));
  166. },
  167. openUnitDetail: function () {
  168. MWF.xDesktop.requireApp("Attendance", "UnitDetail", function () {
  169. this.clearContent();
  170. this.explorerContent = new Element("div", {
  171. "styles": this.css.rightContentNode
  172. }).inject(this.node);
  173. this.explorer = new MWF.xApplication.Attendance.UnitDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  174. this.explorer.load();
  175. }.bind(this));
  176. },
  177. openDingdingUnitDetail: function () {
  178. MWF.xDesktop.requireApp("Attendance", "UnitDingdingDetail", function () {
  179. this.clearContent();
  180. this.explorerContent = new Element("div", {
  181. "styles": this.css.rightContentNode
  182. }).inject(this.node);
  183. this.explorer = new MWF.xApplication.Attendance.UnitDingdingDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  184. this.explorer.load();
  185. }.bind(this));
  186. },
  187. openPeopleDetail: function () {
  188. MWF.xDesktop.requireApp("Attendance", "PeopleDetail", function () {
  189. this.clearContent();
  190. this.explorerContent = new Element("div", {
  191. "styles": this.css.rightContentNode
  192. }).inject(this.node);
  193. this.explorer = new MWF.xApplication.Attendance.PeopleDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  194. this.explorer.load();
  195. }.bind(this));
  196. },
  197. openDingdingPeopleDetail: function () {
  198. MWF.xDesktop.requireApp("Attendance", "PeopleDingdingDetail", function () {
  199. this.clearContent();
  200. this.explorerContent = new Element("div", {
  201. "styles": this.css.rightContentNode
  202. }).inject(this.node);
  203. this.explorer = new MWF.xApplication.Attendance.PeopleDingdingDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  204. this.explorer.load();
  205. }.bind(this));
  206. },
  207. openTopUnitDetail: function () {
  208. MWF.xDesktop.requireApp("Attendance", "TopUnitDetail", function () {
  209. this.clearContent();
  210. this.explorerContent = new Element("div", {
  211. "styles": this.css.rightContentNode
  212. }).inject(this.node);
  213. this.explorer = new MWF.xApplication.Attendance.TopUnitDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  214. this.explorer.load();
  215. }.bind(this));
  216. },
  217. openSelfHoliday: function () {
  218. MWF.xDesktop.requireApp("Attendance", "SelfHoliday", function () {
  219. this.clearContent();
  220. this.explorerContent = new Element("div", {
  221. "styles": this.css.rightContentNode
  222. }).inject(this.node);
  223. this.explorer = new MWF.xApplication.Attendance.SelfHoliday(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  224. this.explorer.load();
  225. }.bind(this));
  226. },
  227. openMyAppealDeal: function () {
  228. MWF.xDesktop.requireApp("Attendance", "MyAppeal", function () {
  229. this.clearContent();
  230. this.explorerContent = new Element("div", {
  231. "styles": this.css.rightContentNode
  232. }).inject(this.node);
  233. this.explorer = new MWF.xApplication.Attendance.MyAppeal(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  234. this.explorer.load();
  235. }.bind(this));
  236. },
  237. openAppealDeal: function () {
  238. MWF.xDesktop.requireApp("Attendance", "AppealExplorer", function () {
  239. this.clearContent();
  240. this.explorerContent = new Element("div", {
  241. "styles": this.css.rightContentNode
  242. }).inject(this.node);
  243. this.explorer = new MWF.xApplication.Attendance.AppealExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  244. this.explorer.load();
  245. }.bind(this));
  246. },
  247. openImporting: function () {
  248. MWF.xDesktop.requireApp("Attendance", "ImportExplorer", function () {
  249. this.clearContent();
  250. this.explorerContent = new Element("div", {
  251. "styles": this.css.rightContentNode
  252. }).inject(this.node);
  253. this.explorer = new MWF.xApplication.Attendance.ImportExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  254. this.explorer.load();
  255. }.bind(this));
  256. },
  257. openImportedInvalidInfor: function () {
  258. MWF.xDesktop.requireApp("Attendance", "InvalidInfor", function () {
  259. this.clearContent();
  260. this.explorerContent = new Element("div", {
  261. "styles": this.css.rightContentNode
  262. }).inject(this.node);
  263. this.explorer = new MWF.xApplication.Attendance.InvalidInfor(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  264. this.explorer.load();
  265. }.bind(this));
  266. },
  267. openAbnormalExport: function () {
  268. MWF.xDesktop.requireApp("Attendance", "AbnormalExport", function () {
  269. this.clearContent();
  270. this.explorerContent = new Element("div", {
  271. "styles": this.css.rightContentNode
  272. }).inject(this.node);
  273. this.explorer = new MWF.xApplication.Attendance.AbnormalExport(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  274. this.explorer.load();
  275. }.bind(this));
  276. },
  277. openScheduleSetting: function () {
  278. MWF.xDesktop.requireApp("Attendance", "ScheduleExplorer", function () {
  279. this.clearContent();
  280. this.explorerContent = new Element("div", {
  281. "styles": this.css.rightContentNode
  282. }).inject(this.node);
  283. this.explorer = new MWF.xApplication.Attendance.ScheduleExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  284. this.explorer.load();
  285. }.bind(this));
  286. },
  287. openPermissionSetting: function () {
  288. MWF.xDesktop.requireApp("Attendance", "PermissionExplorer", function () {
  289. this.clearContent();
  290. this.explorerContent = new Element("div", {
  291. "styles": this.css.rightContentNode
  292. }).inject(this.node);
  293. this.explorer = new MWF.xApplication.Attendance.PermissionExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  294. this.explorer.load();
  295. }.bind(this));
  296. },
  297. openHolidaySetting: function () {
  298. MWF.xDesktop.requireApp("Attendance", "HolidayExplorer", function () {
  299. this.clearContent();
  300. this.explorerContent = new Element("div", {
  301. "styles": this.css.rightContentNode
  302. }).inject(this.node);
  303. this.explorer = new MWF.xApplication.Attendance.HolidayExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  304. this.explorer.load();
  305. }.bind(this));
  306. },
  307. openStaticsCycleExplorer: function () {
  308. MWF.xDesktop.requireApp("Attendance", "StatisticsCycle", function () {
  309. this.clearContent();
  310. this.explorerContent = new Element("div", {
  311. "styles": this.css.rightContentNode
  312. }).inject(this.node);
  313. this.explorer = new MWF.xApplication.Attendance.StatisticsCycle(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  314. this.explorer.load();
  315. }.bind(this));
  316. },
  317. openAppSetting: function () {
  318. MWF.xDesktop.requireApp("Attendance", "AppSetting", function () {
  319. var setting = new MWF.xApplication.Attendance.AppSetting(this, this.restActions);
  320. setting.edit();
  321. }.bind(this));
  322. },
  323. openWeekendSetting : function(){
  324. MWF.xDesktop.requireApp("Attendance", "WeekendSetting", function(){
  325. var setting = new MWF.xApplication.Attendance.WeekendSetting(this,this.restActions);
  326. setting.edit();
  327. }.bind(this));
  328. },
  329. openAddressSetting: function () {
  330. MWF.xDesktop.requireApp("Attendance", "AddressExplorer", function () {
  331. this.clearContent();
  332. this.explorerContent = new Element("div", {
  333. "styles": this.css.rightContentNode
  334. }).inject(this.node);
  335. this.explorer = new MWF.xApplication.Attendance.AddressExplorer(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  336. this.explorer.load();
  337. }.bind(this));
  338. },
  339. openPersonSetting: function () {
  340. MWF.xDesktop.requireApp("Attendance", "PersonSetting", function () {
  341. this.clearContent();
  342. this.explorerContent = new Element("div", {
  343. "styles": this.css.rightContentNode
  344. }).inject(this.node);
  345. this.explorer = new MWF.xApplication.Attendance.PersonSetting(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
  346. this.explorer.load();
  347. }.bind(this));
  348. },
  349. recordStatus: function () {
  350. return this.navi && this.navi.currentItem ? this.navi.currentItem.retrieve("data") : {};
  351. }
  352. });
  353. MWF.xApplication.Attendance.Navi = new Class({
  354. Implements: [Options, Events],
  355. options: {
  356. "id": ""
  357. },
  358. initialize: function (app, node, options) {
  359. this.setOptions(options);
  360. this.app = app;
  361. this.node = $(node);
  362. this.css = this.app.css;
  363. this.currentMenu = null;
  364. this.currentItem = null;
  365. this.menus = {};
  366. this.items = {};
  367. this.elements = [];
  368. this.load();
  369. },
  370. load: function () {
  371. this.scrollNode = new Element("div.naviScrollNode", { "styles": this.css.naviScrollNode }).inject(this.node);
  372. this.areaNode = new Element("div.naviAreaNode", { "styles": this.css.naviAreaNode }).inject(this.scrollNode);
  373. this.setNodeScroll();
  374. var naviUrl = this.app.path + "navi.json";
  375. MWF.getJSON(naviUrl, function (json) {
  376. json.each(function (navi) {
  377. if (navi.access && navi.access == "admin") {
  378. if (this.app.isAdmin()) this.createNaviNode(navi);
  379. } else if (navi.access && navi.access == "admin_dept") {
  380. if (this.app.isUnitManager() || this.app.isAdmin()) this.createNaviNode(navi);
  381. } else if (navi.access && navi.access == "dingding") { //启用钉钉考勤同步后
  382. debugger;
  383. if ((this.app.isUnitManager() || this.app.isAdmin()) && (this.app.enableType == "dingding")) this.createNaviNode(navi);
  384. } else {
  385. this.createNaviNode(navi);
  386. }
  387. }.bind(this));
  388. if (this.options.id == "") this.elements[0].click();
  389. this.setContentSize();
  390. this.app.addEvent("resize", this.setContentSize.bind(this));
  391. }.bind(this));
  392. },
  393. setNodeScroll: function () {
  394. MWF.require("MWF.widget.DragScroll", function () {
  395. new MWF.widget.DragScroll(this.scrollNode);
  396. }.bind(this));
  397. MWF.require("MWF.widget.ScrollBar", function () {
  398. new MWF.widget.ScrollBar(this.scrollNode, { "indent": false });
  399. }.bind(this));
  400. },
  401. createNaviNode: function (data) {
  402. if (data.type == "sep") {
  403. var flag = true;
  404. if (data.access == "admin") {
  405. if (!this.app.isAdmin()) flag = false;
  406. } else if (data.access && data.access == "admin_dept") {
  407. if (!this.app.isUnitManager() && !this.app.isAdmin()) flag = false;
  408. }
  409. if (flag) {
  410. new Element("div", { "styles": this.css.viewNaviSepartorNode }).inject(this.areaNode);
  411. }
  412. } else if (data.sub && data.sub.length > 0) {
  413. this.createNaviMenuNode(data);
  414. } else {
  415. this.menus[data.id] = {};
  416. this.createNaviItemNode(data, data.id);
  417. }
  418. },
  419. createNaviMenuNode: function (data) {
  420. if (data.access == "admin") {
  421. if (!this.app.isAdmin()) return;
  422. } else if (data.access == "admin_dept") {
  423. if (!this.app.isUnitManager() && !this.app.isAdmin()) return;
  424. }
  425. var _self = this;
  426. var menuNode = new Element("div", {
  427. "styles": this.css.naviMenuNode
  428. });
  429. menuNode.store("data", data);
  430. menuNode.store("type", "menu");
  431. var textNode = new Element("div", {
  432. "styles": this.css.naviMenuTextNode,
  433. "text": data.title
  434. });
  435. textNode.inject(menuNode);
  436. menuNode.inject(this.areaNode);
  437. this.menus[data.id] = {};
  438. this.menus[data.id].node = menuNode;
  439. this.elements.push(menuNode);
  440. menuNode.addEvents({
  441. "mouseover": function () { if (_self.currentMenu != this) this.setStyles(_self.app.css.naviMenuNode_over); },
  442. "mouseout": function () { if (_self.currentMenu != this) this.setStyles(_self.app.css.naviMenuNode); },
  443. "mousedown": function () { if (_self.currentMenu != this) this.setStyles(_self.app.css.naviMenuNode_down); },
  444. "mouseup": function () { if (_self.currentMenu != this) this.setStyles(_self.app.css.naviMenuNode_over); },
  445. "click": function () {
  446. //if (_self.currentNavi!=this) _self.doAction.apply(_self, [this]);
  447. _self.clickMenu.apply(_self, [this]);
  448. }
  449. });
  450. data.sub.each(function (d) {
  451. this.createNaviItemNode(d, data.id, menuNode)
  452. }.bind(this))
  453. },
  454. clickMenu: function (naviNode) {
  455. var navi = naviNode.retrieve("data");
  456. var action = navi.action;
  457. this.closeCurrentMenu();
  458. if (this.menus[navi.id].itemNodes) {
  459. this.menus[navi.id].itemNodes.each(function (itemNode) {
  460. itemNode.setStyle("display", "block");
  461. })
  462. }
  463. var type = naviNode.retrieve("type");
  464. if (!navi.target || navi.target != "_blank") {
  465. naviNode.setStyles(this.css.naviMenuNode_current);
  466. this.currentMenu = naviNode;
  467. }
  468. },
  469. closeCurrentMenu: function () {
  470. if (this.currentMenu) {
  471. var data = this.currentMenu.retrieve("data");
  472. if (this.menus[data.id].itemNodes) {
  473. this.menus[data.id].itemNodes.each(function (itemNode) {
  474. itemNode.setStyle("display", "none");
  475. })
  476. }
  477. this.currentMenu.setStyles(this.css.naviMenuNode);
  478. }
  479. },
  480. createNaviItemNode: function (data, menuId) {
  481. if (data.access == "admin") {
  482. if (!this.app.isAdmin()) return;
  483. } else if (data.access && data.access == "admin_dept") {
  484. if (!this.app.isUnitManager() && !this.app.isAdmin()) return;
  485. }
  486. var _self = this;
  487. var items = this.menus[menuId].itemNodes = this.menus[menuId].itemNodes || [];
  488. var itemNode = new Element("div", {
  489. "styles": this.css.naviItemNode
  490. });
  491. itemNode.setStyle("display", "block");
  492. items.push(itemNode);
  493. itemNode.store("data", data);
  494. itemNode.store("type", "item");
  495. var textNode = new Element("div", {
  496. "styles": this.css.naviItemTextNode,
  497. "text": data.title
  498. });
  499. textNode.inject(itemNode);
  500. itemNode.inject(this.areaNode);
  501. this.elements.push(itemNode);
  502. this.items[data.id] = itemNode;
  503. itemNode.addEvents({
  504. "mouseover": function () { if (_self.currentItem != this) this.setStyles(_self.app.css.naviItemNode_over); },
  505. "mouseout": function () { if (_self.currentItem != this) this.setStyles(_self.app.css.naviItemNode); },
  506. "mousedown": function () { if (_self.currentItem != this) this.setStyles(_self.app.css.naviItemNode_down); },
  507. "mouseup": function () { if (_self.currentItem != this) this.setStyles(_self.app.css.naviItemNode_over); },
  508. "click": function () {
  509. _self.clickItem.apply(_self, [this]);
  510. }
  511. });
  512. if (data.id == this.options.id) {
  513. itemNode.click();
  514. }
  515. },
  516. clickItem: function (naviNode) {
  517. var navi = naviNode.retrieve("data");
  518. var action = navi.action;
  519. var type = naviNode.retrieve("type");
  520. if (!navi.target || navi.target != "_blank") {
  521. if (this.currentItem) this.currentItem.setStyles(this.css.naviItemNode);
  522. naviNode.setStyles(this.css.naviItemNode_current);
  523. this.currentItem = naviNode;
  524. }
  525. if (navi.action && this.app[navi.action]) {
  526. this.app[navi.action].call(this.app, navi);
  527. }
  528. },
  529. setContentSize: function () {
  530. var size = this.app.content.getSize();
  531. this.scrollNode.setStyle("height", size.y - 5);
  532. }
  533. //loadCalendar: function () {
  534. // var calendarArea = new Element("div#calendarArea",{
  535. // "styles" : this.css.calendarArea
  536. // }).inject(this.node)
  537. // this.calendar = new MWF.xApplication.Attendance.Calendar( calendarArea, this.app, this.actions )
  538. // this.calendar.load();
  539. //}
  540. });