Skip to content

Commit 034b8d9

Browse files
author
edwinhuish
committed
Change the structure
1 parent 0774af3 commit 034b8d9

9 files changed

+157
-312
lines changed

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,9 @@ The following is the default configuration, you can modify as you want.
6565
```html
6666
<script>
6767
$('#content_wrapper').multitabs({
68-
smartBtn : true, //while is true, show close button in hover, if false, show close button always
69-
draggable : true, //nav tab draggable option
70-
fixed : false, //fixed the nav-bar
71-
layout : 'default', //it can be 'default', 'classic' (all hidden tab in dropdown list), and simple
72-
style : 'nav-tabs', //can be nav-tabs or nav-pills
7368
link : '.multitabs', //selector text to trigger multitabs.
7469
iframe : false, //Global iframe mode, default is false, is the auto mode (for the self page, use ajax, and the external, use iframe)
7570
class : '', //class for whole multitabs
76-
type : 'info', //change the default content type name, is not necessary to change.
7771
init : [ //tabs in initial
7872
{
7973
type :'', //content type, may be main | info, if empty, default is 'info'
@@ -84,34 +78,41 @@ The following is the default configuration, you can modify as you want.
8478
{ /** more tabs**/ }, //add more page.
8579
{ /** more tabs**/ }, //add more page.
8680
],
87-
navBar : {
88-
class : '', //class of navBar
89-
maxTabs : 15, //Max tabs number (without counting main tab), when is 1, hide the whole navBar
90-
maxTitleLength : 25, //Max title length of tab
81+
nav : {
9182
backgroundColor : '#f5f5f5', //default nav-bar background color
83+
class : '', //class of nav
84+
draggable : true, //nav tab draggable option
85+
fixed : false, //fixed the nav-bar
86+
layout : 'default', //it can be 'default', 'classic' (all hidden tab in dropdown list), and simple
87+
maxTabs : 15, //Max tabs number (without counting main tab), when is 1, hide the whole nav
88+
maxTitleLength : 25, //Max title length of tab
89+
showCloseOnHover : true, //while is true, show close button in hover, if false, show close button always
90+
style : 'nav-tabs', //can be nav-tabs or nav-pills
9291
},
93-
ajaxTabPane : {
94-
class : '', //Class for ajax tab-pane
95-
},
96-
iframeTabPane : {
97-
class : '', //Class for iframe tab-pane
92+
content : {
93+
ajax : {
94+
class : '', //Class for ajax tab-pane
95+
error : function (htmlCallBack) {
96+
//modify html and return
97+
return htmlCallBack;
98+
},
99+
success : function (htmlCallBack) {
100+
//modify html and return
101+
return htmlCallBack;
102+
}
103+
},
104+
iframe : {
105+
class : '' //Class for iframe tab-pane
106+
}
98107
},
99108
language : { //language setting
100-
navBar : {
109+
nav : {
101110
title : 'Tab', //default tab's tittle
102111
dropdown : '<i class="fa fa-bars"></i>', //right tools dropdown name
103112
showActivedTab : 'Show Activated Tab', //show active tab
104113
closeAllTabs : 'Close All Tabs', //close all tabs
105114
closeOtherTabs : 'Close Other Tabs', //close other tabs
106115
}
107-
},
108-
ajaxSuccess : function (htmlCallBack) {
109-
//modify html and return
110-
return htmlCallBack;
111-
},
112-
ajaxError : function (htmlCallBack) {
113-
//modify html and return
114-
return htmlCallBack;
115116
}
116117
});
117118
</script>

README_cn.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,9 @@ Demo: [nav-tabs](http://edwinhuish.oschina.io/multi-tabs/demo/index-simple.html)
6464
```html
6565
<script>
6666
$('#content_wrapper').multitabs({
67-
smartBtn : true, //当值为true,仅在鼠标悬浮时显示关闭按钮。false时一直显示
68-
draggable : true, //nav tab 可拖动选项
69-
fixed : false, //固定标签头列表
70-
layout : 'default', //有两种模式,'default', 'classic'(所有隐藏tab都在下拉菜单里) 和 'simple'
71-
style : 'nav-tabs', //可以为nav-tabs 或 nav-pills
7267
link : '.multitabs', //触发multitabs的selector text,注意需要有".","#"等
7368
iframe : false, //iframe模式的总局设置。当值为false的时候,为智能模式,自动判断(内网用ajax,外网用iframe)。缺省为false。
7469
class : '', //主框架的class
75-
type : 'info', //此处可以指定缺省标签页类型名称,一般不需要修改。
7670
init : [ //需要在初始加载的tab
7771
{
7872
type :'', //标签页的类型,有 main | info,缺省为 info
@@ -83,34 +77,41 @@ Demo: [nav-tabs](http://edwinhuish.oschina.io/multi-tabs/demo/index-simple.html)
8377
{ /** 更多tab。。**/ }, //依次添加需要的页面
8478
{ /** 更多tab。。**/ }, //依次添加需要的页面
8579
],
86-
navBar : {
87-
class : '', //为navBar添加class
80+
nav : {
81+
backgroundColor : '#f5f5f5', //默认nav-bar 背景颜色
82+
class : '', //为nav添加class
83+
draggable : true, //nav tab 可拖动选项
84+
fixed : false, //固定标签头列表
85+
layout : 'default', //有两种模式,'default', 'classic'(所有隐藏tab都在下拉菜单里) 和 'simple'
8886
maxTabs : 15, //最多tab数量。(main和editor不计算在内) 当为1时,整个标签栏隐藏。main和editor分别只能有1个标签。
8987
maxTabTitleLength : 25, //tab标题的最大长度
90-
backgroundColor : '#f5f5f5', //默认nav-bar 背景颜色
91-
},
92-
ajaxTabPane : {
93-
class : '', //为ajax tab-pane 添加class
88+
showCloseOnHover : true, //当值为true,仅在鼠标悬浮时显示关闭按钮。false时一直显示
89+
style : 'nav-tabs', //可以为nav-tabs 或 nav-pills
9490
},
95-
iframeTabPane : {
96-
class : '', //为iframe tab-pane 添加class
91+
content : {
92+
ajax : {
93+
class : '', //为ajax tab-pane 添加class
94+
error : function (htmlCallBack) {
95+
//modify html and return
96+
return htmlCallBack;
97+
},
98+
success : function (htmlCallBack) {
99+
//modify html and return
100+
return htmlCallBack;
101+
}
102+
},
103+
iframe : {
104+
class : '' //为iframe tab-pane 添加class
105+
}
97106
},
98107
language : { //语言配置
99-
navBar : {
108+
nav : {
100109
title : 'Tab', //默认的标签页名称
101110
dropdown : '<i class="fa fa-bars"></i>', //标签栏的下拉菜单名称
102111
showActivedTab : 'Show Activated Tab', //下拉菜单的显示激活页面
103112
closeAllTabs : 'Close All Tabs', //下拉菜单的关闭所有页面
104113
closeOtherTabs : 'Close Other Tabs', //下拉菜单的关闭其他页面
105114
}
106-
},
107-
ajaxSuccess : function (htmlCallBack) {
108-
//自行修改 success 的 html 后返回
109-
return htmlCallBack;
110-
},
111-
ajaxError : function (htmlCallBack) {
112-
//自行修改 error 的 html 后返回
113-
return htmlCallBack;
114115
}
115116
});
116117
</script>

demo/index-classic-pills.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@
167167

168168
<script>
169169
var multitabs = $('#content_wrapper').multitabs({
170-
layout : 'classic',
171-
style : 'nav-pills'
170+
nav : {
171+
layout : 'classic',
172+
style : 'nav-pills'
173+
}
172174
});
173175
</script>
174176

demo/index-classic.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@
167167

168168
<script>
169169
var multitabs = $('#content_wrapper').multitabs({
170-
layout : 'classic'
170+
nav :{
171+
layout : 'classic'
172+
}
171173
});
172174
</script>
173175

demo/index-default-pills.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@
167167

168168
<script>
169169
var multitabs = $('#content_wrapper').multitabs({
170-
style : 'nav-pills'
170+
nav : {
171+
style : 'nav-pills'
172+
}
171173
});
172174
</script>
173175

demo/index-showHash.html

Lines changed: 0 additions & 175 deletions
This file was deleted.

demo/index-simple-pills.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@
167167

168168
<script>
169169
var multitabs = $('#content_wrapper').multitabs({
170-
layout : 'simple',
171-
style : 'nav-pills'
170+
nav : {
171+
layout : 'simple',
172+
style : 'nav-pills'
173+
}
172174
});
173175
</script>
174176

demo/index-simple.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@
167167

168168
<script>
169169
var multitabs = $('#content_wrapper').multitabs({
170-
layout : 'simple'
170+
nav : {
171+
layout : 'simple'
172+
}
171173
});
172174
</script>
173175

0 commit comments

Comments
 (0)