tab.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. /** iwb_admin-v1.1.0 MIT License By http://www.iwbnet.com e-mail:yueyy@iwbnet.com */
  2. /**
  3. * Name:tab.js
  4. * Author:Van
  5. * E-mail:yueyy@iwbnet.com
  6. * Website:http://www.iwbnet.com
  7. * LICENSE:MIT
  8. */
  9. layui.define(['jquery', 'element', 'nprogress', 'utils'], function (exports) {
  10. var $ = layui.jquery,
  11. //modName = 'tab',
  12. element = layui.element,
  13. utils = layui.utils,
  14. doc = $(document),
  15. win = $(window),
  16. renderType = {
  17. page: 'page',
  18. iframe: 'iframe'
  19. };
  20. //私用对象
  21. var tab = {
  22. _config: {},
  23. _filter: 'iwbTab', //过滤器名
  24. _title: undefined,
  25. _content: undefined,
  26. _parentElem: undefined, //要存放的容器
  27. //检查选项卡DOM是否存在
  28. tabDomExists: function () {
  29. var that = this;
  30. if (doc.find('div.iwb-tab').length > 0) {
  31. that._title = $('.iwb-tab ul.layui-tab-title');
  32. that._content = $('.iwb-tab div.layui-tab-content');
  33. return true;
  34. }
  35. return false;
  36. },
  37. /**
  38. * 创建选项卡DOM
  39. */
  40. createTabDom: function () {
  41. var that = this,
  42. config = that._config;
  43. that._parentElem = config.elem;
  44. if (that.tabDomExists())
  45. return;
  46. //模板
  47. var tpl = [
  48. '<div class="layui-tab layui-tab-card iwb-tab" lay-filter="' + that._filter + '">',
  49. '<ul class="layui-tab-title">',
  50. '<li class="layui-this" lay-id="-1" data-url="' +
  51. config.mainUrl +
  52. '"><i class="layui-icon layui-icon-home"></i></li>',
  53. '</ul>',
  54. '<i class="fa fa-chevron-down iwb-tab-tool"></i>',
  55. '<div class="iwb-tab-tool-body layui-anim layui-anim-upbit" id="kuaijie">',
  56. '<ul id="menudiv">',
  57. // '<li class="iwb-item"><a class="iwb-item" data-target="refresh">刷新当前标签页</a></li>',
  58. // '<li class="iwb-item"><a class="iwb-item" data-target="closeCurrent">关闭当前标签页</a></li>',
  59. '<li class="iwb-item"><a class="iwb-item" data-target="closeOther">关闭其他标签页</a></li>',
  60. '<li class="iwb-item"><a class="iwb-item" data-target="closeAll">关闭全部标签页</a></li>',
  61. '</ul>',
  62. '</div>',
  63. '<div class="layui-tab-content">',
  64. '<div class="layui-tab-item layui-show" lay-item-id="-1">{{content}}</div>',
  65. '</div>',
  66. '</div>'
  67. ];
  68. var html = tpl.join('');
  69. switch (config.renderType) {
  70. case renderType.page:
  71. html = html.replace('{{content}}', that.getBodyContent(config.mainUrl + '?v=' + new Date().getTime()));
  72. break;
  73. case renderType.iframe:
  74. html = html.replace('{{content}}', '<iframe src="' + config.mainUrl + '"></iframe>');
  75. break;
  76. }
  77. //渲染
  78. $(config.elem).html(html);
  79. that._title = $('.iwb-tab ul.layui-tab-title');
  80. that._content = $('.iwb-tab div.layui-tab-content');
  81. var tool = $('.iwb-tab-tool'),
  82. toolBody = $('.iwb-tab-tool-body'),
  83. tooMenu = $('#kuaijie');
  84. //监听操作点击事件
  85. tool.on('click', function () {
  86. tooMenu.toggle();
  87. });
  88. //tooMenu.mouseout(function () {
  89. // tooMenu.hide();
  90. //});
  91. //监听操作项点击事件
  92. toolBody.find('a.iwb-item').each(function () {
  93. var $that = $(this);
  94. var target = $that.data('target');
  95. $that.off('click').on('click', function () {
  96. var layId = that._title.children('li[class=layui-this]').attr('lay-id');
  97. switch (target) {
  98. case 'refresh': //刷新
  99. switch (config.renderType) {
  100. case renderType.page:
  101. var loadIndex = that.load();
  102. var url = that._title.children('li[lay-id=' + layId + ']').data('url');
  103. that._content.children('div[lay-item-id=' + layId + ']')
  104. .html(that.getBodyContent(url + '?v=' + new Date().getTime(), function () {
  105. that.closeLoad(loadIndex);
  106. }));
  107. break;
  108. case renderType.iframe:
  109. var item = that._content.children('div[lay-item-id=' + layId + ']').children('iframe');
  110. item.attr('src', item.attr('src'));
  111. break;
  112. }
  113. break;
  114. case 'closeCurrent': //关闭当前
  115. if (layId !== "-1")
  116. that.tabDelete(layId);
  117. break;
  118. case 'closeOther': //关闭其他
  119. that._title.children('li[lay-id]').each(function () {
  120. var curId = $(this).attr('lay-id');
  121. if (curId !== layId && curId !== "-1")
  122. that.tabDelete(curId);
  123. });
  124. break;
  125. case 'closeAll': //关闭所有
  126. that._title.children('li[lay-id]').each(function () {
  127. var curId = $(this).attr('lay-id');
  128. if (curId !== "-1")
  129. that.tabDelete(curId);
  130. });
  131. that.tabChange(-1);
  132. break;
  133. }
  134. //_tool.click();
  135. tooMenu.hide();
  136. });
  137. });
  138. //监听浏览器窗口改变事件
  139. that.winResize();
  140. },
  141. load: function () {
  142. return layer.load(0, { shade: [0.3, '#333'] });
  143. },
  144. closeLoad: function (index) {
  145. setTimeout(function () {
  146. index && layer.close(index);
  147. }, 500);
  148. },
  149. getBodyContent: function (url, callback) {
  150. return utils.getBodyContent(utils.loadHtml(url, callback));
  151. },
  152. /**
  153. * 监听浏览器窗口改变事件
  154. */
  155. winResize: function () {
  156. var that = this,
  157. config = that._config;
  158. win.on('resize', function () {
  159. var currBoxHeight = $(that._parentElem).height(); //获取当前容器的高度
  160. switch (config.renderType) {
  161. case renderType.page:
  162. $('.iwb-tab .layui-tab-content').height(currBoxHeight - 43);
  163. break;
  164. case renderType.iframe:
  165. $('.iwb-tab .layui-tab-content iframe').height(currBoxHeight - 47);
  166. break;
  167. }
  168. }).resize();
  169. },
  170. /**
  171. * 检查选项卡是否存在
  172. */
  173. tabExists: function (layId) {
  174. var that = this;
  175. return that._title.find('li[lay-id=' + layId + ']').length > 0;
  176. },
  177. /**
  178. * 删除选项卡
  179. */
  180. tabDelete: function (layId) {
  181. element.tabDelete(this._filter, layId);
  182. },
  183. /**
  184. * 设置选中选项卡
  185. */
  186. tabChange: function (layId) {
  187. element.tabChange(this._filter, layId);
  188. },
  189. /**
  190. * 获取选项卡对象
  191. */
  192. getTab: function (layId) {
  193. return this._title.find('li[lay-id=' + layId + ']');
  194. },
  195. /**
  196. * 添加一个选项卡,已存在则获取焦点
  197. */
  198. tabAdd: function (options) {
  199. var that = this,
  200. config = that._config,
  201. loadIndex = undefined;
  202. options = options || {
  203. id: new Date().getTime(),
  204. title: '新标签页',
  205. icon: 'fa-file',
  206. url: '404.html'
  207. };
  208. var title = options.title,
  209. icon = options.icon,
  210. url = options.url,
  211. id = options.id;
  212. if (that.tabExists(id)) {
  213. that.tabChange(id);
  214. $('#refresh').click();
  215. return;
  216. }
  217. NProgress.start();
  218. if (config.openWait)
  219. loadIndex = that.load();
  220. var titleHtml = ['<li class="layui-this" lay-id="' + id + '" data-url="' + url + '">'];
  221. if (icon) {
  222. if (icon.indexOf('fa-') !== -1) {
  223. titleHtml.push('<i class="fa ' + icon + '" aria-hidden="true"></i>');
  224. } else {
  225. titleHtml.push('<i class="layui-icon">' + icon + '</i>');
  226. }
  227. }
  228. titleHtml.push('&nbsp;' + title);
  229. titleHtml.push('<i class="layui-icon layui-unselect layui-tab-close">&#x1006;</i>');
  230. titleHtml.push('</li>');
  231. var contentHtm = '<div class="layui-tab-item layui-show" lay-item-id="' + id + '">{{content}}</div>';
  232. switch (config.renderType) {
  233. case renderType.page:
  234. contentHtm = contentHtm.replace('{{content}}', that.getBodyContent(url + '?v=' + new Date().getTime(), function () {
  235. setTimeout(function () {
  236. NProgress.done();
  237. config.openWait && loadIndex && that.closeLoad(loadIndex);
  238. }, 500);
  239. }));
  240. break;
  241. case renderType.iframe:
  242. contentHtm = contentHtm.replace('{{content}}', '<iframe src="' + url + '"></iframe>');
  243. break;
  244. }
  245. //追加html
  246. that._title.append(titleHtml.join(''));
  247. that._content.append(contentHtm);
  248. if (config.renderType === renderType.iframe) {
  249. that._content.find('div[lay-item-id=' + id + ']').find('iframe').on('load', function () {
  250. NProgress.done();
  251. config.openWait && loadIndex && that.closeLoad(loadIndex);
  252. });
  253. }
  254. //监听选项卡关闭事件
  255. that.getTab(id).find('i.layui-tab-close').off('click').on('click', function () {
  256. //关闭之前
  257. if (config.closeBefore) {
  258. if (config.closeBefore(options)) {
  259. that.tabDelete(id);
  260. }
  261. } else {
  262. that.tabDelete(id);
  263. }
  264. });
  265. that.tabChange(id);
  266. that.winResize();
  267. if (config.onSwitch) {
  268. element.on('tab(' + that._filter + ')', function (data) {
  269. config.onSwitch({
  270. index: data.index,
  271. elem: data.elem,
  272. layId: that._title.children('li').eq(data.index).attr('lay-id')
  273. });
  274. });
  275. }
  276. },
  277. /**
  278. * 获取当前选项卡的id
  279. */
  280. getCurrLayId: function () {
  281. return this._title.find('li.layui-this').attr('lay-id');
  282. }
  283. };
  284. // ReSharper disable once InconsistentNaming
  285. var Tab = function () {
  286. this.config = {
  287. elem: undefined,
  288. mainUrl: "/Main/Home",
  289. renderType: 'iframe',
  290. openWait: false
  291. };
  292. this.v = '1.0.5';
  293. };
  294. Tab.fn = Tab.prototype;
  295. Tab.fn.set = function (options) {
  296. var that = this;
  297. $.extend(true, that.config, options);
  298. return that;
  299. };
  300. /**
  301. * 渲染选项卡
  302. */
  303. Tab.fn.render = function () {
  304. var that = this,
  305. config = that.config;
  306. if (config.elem === undefined) {
  307. layui.hint().error('Tab error:请配置选择卡容器.');
  308. return that;
  309. }
  310. tab._config = config;
  311. tab.createTabDom();
  312. return that;
  313. };
  314. /**
  315. * 添加一个选项卡
  316. */
  317. Tab.fn.tabAdd = function (params) {
  318. tab.tabAdd(params);
  319. };
  320. /**
  321. * 关闭一个选项卡
  322. */
  323. Tab.fn.close = function (layId) {
  324. tab.tabDelete(layId);
  325. };
  326. Tab.fn.getId = function () {
  327. return tab.getCurrLayId();
  328. };
  329. var t = new Tab();
  330. exports('tab', t);
  331. });
  332. //layui.define(['jquery', 'element', 'nprogress', 'utils'], function (exports) {
  333. // var $ = layui.jquery,
  334. // //modName = 'tab',
  335. // element = layui.element,
  336. // utils = layui.utils,
  337. // doc = $(document),
  338. // win = $(window),
  339. // renderType = {
  340. // page: 'page',
  341. // iframe: 'iframe'
  342. // };
  343. // var Tab = function () {
  344. // this.config = {
  345. // elem: undefined,
  346. // mainUrl: "/Home/index",
  347. // renderType: 'iframe',
  348. // openWait: false
  349. // };
  350. // this.v = '1.0.5';
  351. // };
  352. // Tab.fn = Tab.prototype;
  353. // Tab.fn.set = function (options) {
  354. // var that = this;
  355. // $.extend(true, that.config, options);
  356. // return that;
  357. // };
  358. // //私用对象
  359. // var tab = {
  360. // _config: {},
  361. // _filter: 'iwbTab', //过滤器名
  362. // _title: undefined,
  363. // _content: undefined,
  364. // _parentElem: undefined, //要存放的容器
  365. // //检查选项卡DOM是否存在
  366. // tabDomExists: function () {
  367. // var that = this;
  368. // if (doc.find('div.iwb-tab').length > 0) {
  369. // that._title = $('.iwb-tab ul.layui-tab-title');
  370. // that._content = $('.iwb-tab div.layui-tab-content');
  371. // return true;
  372. // }
  373. // return false;
  374. // },
  375. // /**
  376. // * 创建选项卡DOM
  377. // */
  378. // createTabDom: function () {
  379. // var that = this,
  380. // config = that._config;
  381. // that._parentElem = config.elem;
  382. // if (that.tabDomExists())
  383. // return;
  384. // //模板
  385. // var tpl = [
  386. // '<div class="layui-tab layui-tab-card iwb-tab" lay-filter="' + that._filter + '">',
  387. // '<ul class="layui-tab-title">',
  388. // '<li class="layui-this" lay-id="-1" data-url="' +
  389. // config.mainUrl +
  390. // '"><i class="layui-icon layui-icon-home"></i></li>',
  391. // '</ul>',
  392. // '<i class="fa fa-chevron-down iwb-tab-tool"></i>',
  393. // '<div class="iwb-tab-tool-body layui-anim layui-anim-upbit" id="kuaijie">',
  394. // '<ul id="menudiv">',
  395. // // '<li class="iwb-item"><a class="iwb-item" data-target="refresh">刷新当前标签页</a></li>',
  396. // // '<li class="iwb-item"><a class="iwb-item" data-target="closeCurrent">关闭当前标签页</a></li>',
  397. // '<li class="iwb-item"><a class="iwb-item" data-target="closeOther">关闭其他标签页</a></li>',
  398. // '<li class="iwb-item"><a class="iwb-item" data-target="closeAll">关闭全部标签页</a></li>',
  399. // '</ul>',
  400. // '</div>',
  401. // '<div class="layui-tab-content">',
  402. // '<div class="layui-tab-item layui-show" lay-item-id="-1">{{content}}</div>',
  403. // '</div>',
  404. // '</div>'
  405. // ];
  406. // var html = tpl.join('');
  407. // switch (config.renderType) {
  408. // case renderType.page:
  409. // html = html.replace('{{content}}', that.getBodyContent(config.mainUrl + '?v=' + new Date().getTime()));
  410. // break;
  411. // case renderType.iframe:
  412. // html = html.replace('{{content}}', '<iframe src="' + config.mainUrl + '"></iframe>');
  413. // break;
  414. // }
  415. // //渲染
  416. // $(config.elem).html(html);
  417. // that._title = $('.iwb-tab ul.layui-tab-title');
  418. // that._content = $('.iwb-tab div.layui-tab-content');
  419. // var tool = $('.iwb-tab-tool'),
  420. // toolBody = $('.iwb-tab-tool-body'),
  421. // tooMenu = $('#kuaijie');
  422. // //监听操作点击事件
  423. // tool.on('click', function () {
  424. // tooMenu.toggle();
  425. // });
  426. // tooMenu.mouseout(function() {
  427. // tooMenu.hide();
  428. // });
  429. // //监听操作项点击事件
  430. // toolBody.find('a.iwb-item').each(function () {
  431. // var $that = $(this);
  432. // var target = $that.data('target');
  433. // $that.off('click').on('click', function () {
  434. // var layId = that._title.children('li[class=layui-this]').attr('lay-id');
  435. // switch (target) {
  436. // case 'refresh': //刷新
  437. // switch (config.renderType) {
  438. // case renderType.page:
  439. // var loadIndex = that.load();
  440. // var url = that._title.children('li[lay-id=' + layId + ']').data('url');
  441. // that._content.children('div[lay-item-id=' + layId + ']')
  442. // .html(that.getBodyContent(url + '?v=' + new Date().getTime(), function () {
  443. // that.closeLoad(loadIndex);
  444. // }));
  445. // break;
  446. // case renderType.iframe:
  447. // var item = that._content.children('div[lay-item-id=' + layId + ']').children('iframe');
  448. // item.attr('src', item.attr('src'));
  449. // break;
  450. // }
  451. // break;
  452. // case 'closeCurrent': //关闭当前
  453. // if (layId !== -1)
  454. // that.tabDelete(layId);
  455. // break;
  456. // case 'closeOther': //关闭其他
  457. // that._title.children('li[lay-id]').each(function () {
  458. // var curId = $(this).attr('lay-id');
  459. // if (curId !== layId && curId !== -1)
  460. // that.tabDelete(curId);
  461. // });
  462. // break;
  463. // case 'closeAll': //关闭所有
  464. // that._title.children('li[lay-id]').each(function () {
  465. // var curId = $(this).attr('lay-id');
  466. // if (curId !== -1)
  467. // that.tabDelete(curId);
  468. // });
  469. // that.tabChange(-1);
  470. // break;
  471. // }
  472. // //_tool.click();
  473. // tooMenu.hide();
  474. // });
  475. // });
  476. // //监听浏览器窗口改变事件
  477. // that.winResize();
  478. // },
  479. // load: function () {
  480. // return layer.load(0, { shade: [0.3, '#333'] });
  481. // },
  482. // closeLoad: function (index) {
  483. // setTimeout(function () {
  484. // index && layer.close(index);
  485. // }, 500);
  486. // },
  487. // getBodyContent: function (url, callback) {
  488. // return utils.getBodyContent(utils.loadHtml(url, callback));
  489. // },
  490. // /**
  491. // * 监听浏览器窗口改变事件
  492. // */
  493. // winResize: function () {
  494. // var that = this,
  495. // config = that._config;
  496. // win.on('resize', function () {
  497. // var currBoxHeight = $(that._parentElem).height(); //获取当前容器的高度
  498. // switch (config.renderType) {
  499. // case renderType.page:
  500. // $('.iwb-tab .layui-tab-content').height(currBoxHeight - 43);
  501. // break;
  502. // case renderType.iframe:
  503. // $('.iwb-tab .layui-tab-content iframe').height(currBoxHeight - 47);
  504. // break;
  505. // }
  506. // }).resize();
  507. // },
  508. // /**
  509. // * 检查选项卡是否存在
  510. // */
  511. // tabExists: function (layId) {
  512. // var that = this;
  513. // return that._title.find('li[lay-id=' + layId + ']').length > 0;
  514. // },
  515. // /**
  516. // * 删除选项卡
  517. // */
  518. // tabDelete: function (layId) {
  519. // element.tabDelete(this._filter, layId);
  520. // },
  521. // /**
  522. // * 设置选中选项卡
  523. // */
  524. // tabChange: function (layId) {
  525. // element.tabChange(this._filter, layId);
  526. // },
  527. // /**
  528. // * 获取选项卡对象
  529. // */
  530. // getTab: function (layId) {
  531. // return this._title.find('li[lay-id=' + layId + ']');
  532. // },
  533. // /**
  534. // * 添加一个选项卡,已存在则获取焦点
  535. // */
  536. // tabAdd: function (options) {
  537. // var that = this,
  538. // config = that._config,
  539. // loadIndex = undefined;
  540. // options = options || {
  541. // id: new Date().getTime(),
  542. // title: '新标签页',
  543. // icon: 'fa-file',
  544. // url: '404.html'
  545. // };
  546. // var title = options.title,
  547. // icon = options.icon,
  548. // url = options.url,
  549. // id = options.id;
  550. // if (that.tabExists(id)) {
  551. // that.tabChange(id);
  552. // return;
  553. // }
  554. // NProgress.start();
  555. // if (config.openWait)
  556. // loadIndex = that.load();
  557. // var titleHtml = ['<li class="layui-this" lay-id="' + id + '" data-url="' + url + '">'];
  558. // if (icon) {
  559. // if (icon.indexOf('fa-') !== -1) {
  560. // titleHtml.push('<i class="fa ' + icon + '" aria-hidden="true"></i>');
  561. // } else {
  562. // titleHtml.push('<i class="layui-icon">' + icon + '</i>');
  563. // }
  564. // }
  565. // titleHtml.push('&nbsp;' + title);
  566. // titleHtml.push('<i class="layui-icon layui-unselect layui-tab-close">&#x1006;</i>');
  567. // titleHtml.push('</li>');
  568. // var contentHtm = '<div class="layui-tab-item layui-show" lay-item-id="' + id + '">{{content}}</div>';
  569. // switch (config.renderType) {
  570. // case renderType.page:
  571. // contentHtm = contentHtm.replace('{{content}}', that.getBodyContent(url + '?v=' + new Date().getTime(), function () {
  572. // setTimeout(function () {
  573. // NProgress.done();
  574. // config.openWait && loadIndex && that.closeLoad(loadIndex);
  575. // }, 500);
  576. // }));
  577. // break;
  578. // case renderType.iframe:
  579. // contentHtm = contentHtm.replace('{{content}}', '<iframe src="' + url + '"></iframe>');
  580. // break;
  581. // }
  582. // //追加html
  583. // that._title.append(titleHtml.join(''));
  584. // that._content.append(contentHtm);
  585. // if (config.renderType === renderType.iframe) {
  586. // that._content.find('div[lay-item-id=' + id + ']').find('iframe').on('load', function () {
  587. // NProgress.done();
  588. // config.openWait && loadIndex && that.closeLoad(loadIndex);
  589. // });
  590. // }
  591. // //监听选项卡关闭事件
  592. // that.getTab(id).find('i.layui-tab-close').off('click').on('click', function () {
  593. // //关闭之前
  594. // if (config.closeBefore) {
  595. // if (config.closeBefore(options)) {
  596. // that.tabDelete(id);
  597. // }
  598. // } else {
  599. // that.tabDelete(id);
  600. // }
  601. // });
  602. // that.tabChange(id);
  603. // that.winResize();
  604. // if (config.onSwitch) {
  605. // element.on('tab(' + that._filter + ')', function (data) {
  606. // config.onSwitch({
  607. // index: data.index,
  608. // elem: data.elem,
  609. // layId: that._title.children('li').eq(data.index).attr('lay-id')
  610. // });
  611. // });
  612. // }
  613. // },
  614. // /**
  615. // * 获取当前选项卡的id
  616. // */
  617. // getCurrLayId: function () {
  618. // return this._title.find('li.layui-this').attr('lay-id');
  619. // }
  620. // };
  621. // /**
  622. // * 渲染选项卡
  623. // */
  624. // Tab.fn.render = function () {
  625. // var that = this,
  626. // config = that.config;
  627. // if (config.elem === undefined) {
  628. // layui.hint().error('Tab error:请配置选择卡容器.');
  629. // return that;
  630. // }
  631. // tab._config = config;
  632. // tab.createTabDom();
  633. // return that;
  634. // };
  635. // /**
  636. // * 添加一个选项卡
  637. // */
  638. // Tab.fn.tabAdd = function (params) {
  639. // tab.tabAdd(params);
  640. // };
  641. // /**
  642. // * 关闭一个选项卡
  643. // */
  644. // Tab.fn.close = function (layId) {
  645. // tab.tabDelete(layId);
  646. // };
  647. // Tab.fn.getId = function () {
  648. // return tab.getCurrLayId();
  649. // };
  650. // var t = new Tab();
  651. // exports('tab', t);
  652. //});