未验证 提交 907a68a2 编写于 作者: C catouse

* tabs: support for using an object to override the context options in tabs.

上级 ead7b84a
......@@ -76,7 +76,7 @@ $('#tabsExample').tabs({tabs: tabs});
<td><code>contextMenu</code></td>
<td>是否启用上下文菜单</td>
<td>默认为 `true`</td>
<td>如果设置为 `true` 则在导航上启用上下文菜单方便用户操作标签页,当使用鼠标操作时,通常是点击鼠标右键显示一个菜单。</td>
<td>如果设置为 `true` 则在导航上启用上下文菜单方便用户操作标签页,当使用鼠标操作时,通常是点击鼠标右键显示一个菜单;可以设置为一个对象,用于覆盖默认的[上下文菜单](#javascript/contextmenu)初始化选项</td>
</tr>
<tr>
<td><code>defaultTabIcon</code></td>
......
......@@ -76,7 +76,7 @@ $('#tabsExample').tabs({tabs: tabs});
<td><code>contextMenu</code></td>
<td>Whether to enable the context menu</td>
<td>Default:`true`</td>
<td>If set as `true`, enable context menus on the navigation to facilitate user actions on tabs. When using a mouse, right click to display a menu.</td>
<td>If set as `true`, enable context menus on the navigation to facilitate user actions on tabs. When using a mouse, right click to display a menu. The option can be see to an object to override the default options of [contextmenu](#javascript/contextmenu).</td>
</tr>
<tr>
<td><code>defaultTabIcon</code></td>
......
......@@ -161,7 +161,7 @@
});
if (options.contextMenu && $.fn.contextmenu) {
$nav.contextmenu({
var contextMenuOptions = {
selector: '.tab-nav-link',
items: function (e) {
return that.createMenuItems(that.getTab($(this).data('id')));
......@@ -172,7 +172,11 @@
onHide: function () {
that.$.removeClass('tabs-show-contextmenu');
}
});
};
if (typeof options.contextMenu === 'object') {
$.extend(contextMenuOptions, options.contextMenu);
}
$nav.contextmenu(contextMenuOptions);
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册