只读模式
group, 分享
评论更多问题
博客标签总是存在一个
This commit is contained in:
lealife
2015-06-15 18:01:48 +08:00
parent 7e458bb433
commit 6987a38820
1453 changed files with 114561 additions and 91536 deletions

41
public/tinymce/classes/ui/TabPanel.js Normal file → Executable file
View File

@ -24,8 +24,6 @@ define("tinymce/ui/TabPanel", [
"use strict";
return Panel.extend({
lastIdx: 0,
Defaults: {
layout: 'absolute',
defaults: {
@ -40,21 +38,28 @@ define("tinymce/ui/TabPanel", [
* @param {Number} idx Index of the tab to activate.
*/
activateTab: function(idx) {
var activeTabElm;
if (this.activeTabId) {
DomUtils.removeClass(this.getEl(this.activeTabId), this.classPrefix + 'active');
activeTabElm = this.getEl(this.activeTabId);
DomUtils.removeClass(activeTabElm, this.classPrefix + 'active');
activeTabElm.setAttribute('aria-selected', "false");
}
this.activeTabId = 't' + idx;
DomUtils.addClass(this.getEl('t' + idx), this.classPrefix + 'active');
if (idx != this.lastIdx) {
this.items()[this.lastIdx].hide();
this.lastIdx = idx;
}
activeTabElm = this.getEl('t' + idx);
activeTabElm.setAttribute('aria-selected', "true");
DomUtils.addClass(activeTabElm, this.classPrefix + 'active');
this.items()[idx].show().fire('showtab');
this.reflow();
this.items().each(function(item, i) {
if (idx != i) {
item.hide();
}
});
},
/**
@ -70,16 +75,22 @@ define("tinymce/ui/TabPanel", [
layout.preRender(self);
self.items().each(function(ctrl, i) {
var id = self._id + '-t' + i;
ctrl.aria('role', 'tabpanel');
ctrl.aria('labelledby', id);
tabsHtml += (
'<div id="' + self._id + '-t' + i + '" class="' + prefix + 'tab" unselectable="on">' +
'<div id="' + id + '" class="' + prefix + 'tab" ' +
'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' +
self.encode(ctrl.settings.title) +
'</div>'
);
});
return (
'<div id="' + self._id + '" class="' + self.classes() + '" hideFocus="1" tabIndex="-1">' +
'<div id="' + self._id + '-head" class="' + prefix + 'tabs">' +
'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
'<div id="' + self._id + '-head" class="' + prefix + 'tabs" role="tablist">' +
tabsHtml +
'</div>' +
'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
@ -131,12 +142,10 @@ define("tinymce/ui/TabPanel", [
minW = DomUtils.getSize(self.getEl('head')).width;
minW = minW < 0 ? 0 : minW;
minH = 0;
self.items().each(function(item, i) {
self.items().each(function(item) {
minW = Math.max(minW, item.layoutRect().minW);
minH = Math.max(minH, item.layoutRect().minH);
if (self.settings.activeTab != i) {
item.hide();
}
});
self.items().each(function(ctrl) {