v1.0
只读模式 group, 分享 评论更多问题 博客标签总是存在一个
This commit is contained in:
34
public/tinymce/classes/ui/SplitButton.js
Normal file → Executable file
34
public/tinymce/classes/ui/SplitButton.js
Normal file → Executable file
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @-x-less SplitButton.less
|
||||
* @class tinymce.ui.SplitButton
|
||||
* @extends tinymce.ui.Button
|
||||
* @extends tinymce.ui.MenuButton
|
||||
*/
|
||||
define("tinymce/ui/SplitButton", [
|
||||
"tinymce/ui/MenuButton",
|
||||
@ -22,7 +22,7 @@ define("tinymce/ui/SplitButton", [
|
||||
return MenuButton.extend({
|
||||
Defaults: {
|
||||
classes: "widget btn splitbtn",
|
||||
role: "splitbutton"
|
||||
role: "button"
|
||||
},
|
||||
|
||||
/**
|
||||
@ -68,16 +68,32 @@ define("tinymce/ui/SplitButton", [
|
||||
* @return {String} HTML representing the control.
|
||||
*/
|
||||
renderHtml: function() {
|
||||
var self = this, id = self._id, prefix = self.classPrefix;
|
||||
var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
|
||||
var self = this, id = self._id, prefix = self.classPrefix, image;
|
||||
var icon = self.settings.icon;
|
||||
|
||||
image = self.settings.image;
|
||||
if (image) {
|
||||
icon = 'none';
|
||||
|
||||
// Support for [high dpi, low dpi] image sources
|
||||
if (typeof image != "string") {
|
||||
image = window.getSelection ? image[0] : image[1];
|
||||
}
|
||||
|
||||
image = ' style="background-image: url(\'' + image + '\')"';
|
||||
} else {
|
||||
image = '';
|
||||
}
|
||||
|
||||
icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
|
||||
|
||||
return (
|
||||
'<div id="' + id + '" class="' + self.classes() + '">' +
|
||||
'<button type="button" hidefocus tabindex="-1">' +
|
||||
(icon ? '<i class="' + icon + '"></i>' : '') +
|
||||
'<div id="' + id + '" class="' + self.classes() + '" role="button" tabindex="-1">' +
|
||||
'<button type="button" hidefocus="1" tabindex="-1">' +
|
||||
(icon ? '<i class="' + icon + '"' + image + '></i>' : '') +
|
||||
(self._text ? (icon ? ' ' : '') + self._text : '') +
|
||||
'</button>' +
|
||||
'<button type="button" class="' + prefix + 'open" hidefocus tabindex="-1">' +
|
||||
'<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' +
|
||||
//(icon ? '<i class="' + icon + '"></i>' : '') +
|
||||
(self._menuBtnText ? (icon ? '\u00a0' : '') + self._menuBtnText : '') +
|
||||
' <i class="' + prefix + 'caret"></i>' +
|
||||
@ -100,7 +116,7 @@ define("tinymce/ui/SplitButton", [
|
||||
if (e.control == this) {
|
||||
// Find clicks that is on the main button
|
||||
while (node) {
|
||||
if (node.nodeName == 'BUTTON' && node.className.indexOf('open') == -1) {
|
||||
if ((e.aria && e.aria.key != 'down') || (node.nodeName == 'BUTTON' && node.className.indexOf('open') == -1)) {
|
||||
e.stopImmediatePropagation();
|
||||
onClickHandler.call(this, e);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user