Edit File by line
/home/barbar84/www/wp-inclu.../js/tinymce/themes/inlite
File: theme.js
}
[2500] Fix | Delete
if (self.state.get('active')) {
[2501] Fix | Delete
active(true);
[2502] Fix | Delete
}
[2503] Fix | Delete
return self._super();
[2504] Fix | Delete
},
[2505] Fix | Delete
remove: function () {
[2506] Fix | Delete
this._super();
[2507] Fix | Delete
if (this._tooltip) {
[2508] Fix | Delete
this._tooltip.remove();
[2509] Fix | Delete
this._tooltip = null;
[2510] Fix | Delete
}
[2511] Fix | Delete
}
[2512] Fix | Delete
});
[2513] Fix | Delete
[2514] Fix | Delete
var Progress = Widget.extend({
[2515] Fix | Delete
Defaults: { value: 0 },
[2516] Fix | Delete
init: function (settings) {
[2517] Fix | Delete
var self = this;
[2518] Fix | Delete
self._super(settings);
[2519] Fix | Delete
self.classes.add('progress');
[2520] Fix | Delete
if (!self.settings.filter) {
[2521] Fix | Delete
self.settings.filter = function (value) {
[2522] Fix | Delete
return Math.round(value);
[2523] Fix | Delete
};
[2524] Fix | Delete
}
[2525] Fix | Delete
},
[2526] Fix | Delete
renderHtml: function () {
[2527] Fix | Delete
var self = this, id = self._id, prefix = this.classPrefix;
[2528] Fix | Delete
return '<div id="' + id + '" class="' + self.classes + '">' + '<div class="' + prefix + 'bar-container">' + '<div class="' + prefix + 'bar"></div>' + '</div>' + '<div class="' + prefix + 'text">0%</div>' + '</div>';
[2529] Fix | Delete
},
[2530] Fix | Delete
postRender: function () {
[2531] Fix | Delete
var self = this;
[2532] Fix | Delete
self._super();
[2533] Fix | Delete
self.value(self.settings.value);
[2534] Fix | Delete
return self;
[2535] Fix | Delete
},
[2536] Fix | Delete
bindStates: function () {
[2537] Fix | Delete
var self = this;
[2538] Fix | Delete
function setValue(value) {
[2539] Fix | Delete
value = self.settings.filter(value);
[2540] Fix | Delete
self.getEl().lastChild.innerHTML = value + '%';
[2541] Fix | Delete
self.getEl().firstChild.firstChild.style.width = value + '%';
[2542] Fix | Delete
}
[2543] Fix | Delete
self.state.on('change:value', function (e) {
[2544] Fix | Delete
setValue(e.value);
[2545] Fix | Delete
});
[2546] Fix | Delete
setValue(self.state.get('value'));
[2547] Fix | Delete
return self._super();
[2548] Fix | Delete
}
[2549] Fix | Delete
});
[2550] Fix | Delete
[2551] Fix | Delete
var updateLiveRegion = function (ctx, text) {
[2552] Fix | Delete
ctx.getEl().lastChild.textContent = text + (ctx.progressBar ? ' ' + ctx.progressBar.value() + '%' : '');
[2553] Fix | Delete
};
[2554] Fix | Delete
var Notification = Control$1.extend({
[2555] Fix | Delete
Mixins: [Movable],
[2556] Fix | Delete
Defaults: { classes: 'widget notification' },
[2557] Fix | Delete
init: function (settings) {
[2558] Fix | Delete
var self = this;
[2559] Fix | Delete
self._super(settings);
[2560] Fix | Delete
self.maxWidth = settings.maxWidth;
[2561] Fix | Delete
if (settings.text) {
[2562] Fix | Delete
self.text(settings.text);
[2563] Fix | Delete
}
[2564] Fix | Delete
if (settings.icon) {
[2565] Fix | Delete
self.icon = settings.icon;
[2566] Fix | Delete
}
[2567] Fix | Delete
if (settings.color) {
[2568] Fix | Delete
self.color = settings.color;
[2569] Fix | Delete
}
[2570] Fix | Delete
if (settings.type) {
[2571] Fix | Delete
self.classes.add('notification-' + settings.type);
[2572] Fix | Delete
}
[2573] Fix | Delete
if (settings.timeout && (settings.timeout < 0 || settings.timeout > 0) && !settings.closeButton) {
[2574] Fix | Delete
self.closeButton = false;
[2575] Fix | Delete
} else {
[2576] Fix | Delete
self.classes.add('has-close');
[2577] Fix | Delete
self.closeButton = true;
[2578] Fix | Delete
}
[2579] Fix | Delete
if (settings.progressBar) {
[2580] Fix | Delete
self.progressBar = new Progress();
[2581] Fix | Delete
}
[2582] Fix | Delete
self.on('click', function (e) {
[2583] Fix | Delete
if (e.target.className.indexOf(self.classPrefix + 'close') !== -1) {
[2584] Fix | Delete
self.close();
[2585] Fix | Delete
}
[2586] Fix | Delete
});
[2587] Fix | Delete
},
[2588] Fix | Delete
renderHtml: function () {
[2589] Fix | Delete
var self = this;
[2590] Fix | Delete
var prefix = self.classPrefix;
[2591] Fix | Delete
var icon = '', closeButton = '', progressBar = '', notificationStyle = '';
[2592] Fix | Delete
if (self.icon) {
[2593] Fix | Delete
icon = '<i class="' + prefix + 'ico' + ' ' + prefix + 'i-' + self.icon + '"></i>';
[2594] Fix | Delete
}
[2595] Fix | Delete
notificationStyle = ' style="max-width: ' + self.maxWidth + 'px;' + (self.color ? 'background-color: ' + self.color + ';"' : '"');
[2596] Fix | Delete
if (self.closeButton) {
[2597] Fix | Delete
closeButton = '<button type="button" class="' + prefix + 'close" aria-hidden="true">\xD7</button>';
[2598] Fix | Delete
}
[2599] Fix | Delete
if (self.progressBar) {
[2600] Fix | Delete
progressBar = self.progressBar.renderHtml();
[2601] Fix | Delete
}
[2602] Fix | Delete
return '<div id="' + self._id + '" class="' + self.classes + '"' + notificationStyle + ' role="presentation">' + icon + '<div class="' + prefix + 'notification-inner">' + self.state.get('text') + '</div>' + progressBar + closeButton + '<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;"' + ' aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div>' + '</div>';
[2603] Fix | Delete
},
[2604] Fix | Delete
postRender: function () {
[2605] Fix | Delete
var self = this;
[2606] Fix | Delete
global$3.setTimeout(function () {
[2607] Fix | Delete
self.$el.addClass(self.classPrefix + 'in');
[2608] Fix | Delete
updateLiveRegion(self, self.state.get('text'));
[2609] Fix | Delete
}, 100);
[2610] Fix | Delete
return self._super();
[2611] Fix | Delete
},
[2612] Fix | Delete
bindStates: function () {
[2613] Fix | Delete
var self = this;
[2614] Fix | Delete
self.state.on('change:text', function (e) {
[2615] Fix | Delete
self.getEl().firstChild.innerHTML = e.value;
[2616] Fix | Delete
updateLiveRegion(self, e.value);
[2617] Fix | Delete
});
[2618] Fix | Delete
if (self.progressBar) {
[2619] Fix | Delete
self.progressBar.bindStates();
[2620] Fix | Delete
self.progressBar.state.on('change:value', function (e) {
[2621] Fix | Delete
updateLiveRegion(self, self.state.get('text'));
[2622] Fix | Delete
});
[2623] Fix | Delete
}
[2624] Fix | Delete
return self._super();
[2625] Fix | Delete
},
[2626] Fix | Delete
close: function () {
[2627] Fix | Delete
var self = this;
[2628] Fix | Delete
if (!self.fire('close').isDefaultPrevented()) {
[2629] Fix | Delete
self.remove();
[2630] Fix | Delete
}
[2631] Fix | Delete
return self;
[2632] Fix | Delete
},
[2633] Fix | Delete
repaint: function () {
[2634] Fix | Delete
var self = this;
[2635] Fix | Delete
var style, rect;
[2636] Fix | Delete
style = self.getEl().style;
[2637] Fix | Delete
rect = self._layoutRect;
[2638] Fix | Delete
style.left = rect.x + 'px';
[2639] Fix | Delete
style.top = rect.y + 'px';
[2640] Fix | Delete
style.zIndex = 65535 - 1;
[2641] Fix | Delete
}
[2642] Fix | Delete
});
[2643] Fix | Delete
[2644] Fix | Delete
function NotificationManagerImpl (editor) {
[2645] Fix | Delete
var getEditorContainer = function (editor) {
[2646] Fix | Delete
return editor.inline ? editor.getElement() : editor.getContentAreaContainer();
[2647] Fix | Delete
};
[2648] Fix | Delete
var getContainerWidth = function () {
[2649] Fix | Delete
var container = getEditorContainer(editor);
[2650] Fix | Delete
return funcs.getSize(container).width;
[2651] Fix | Delete
};
[2652] Fix | Delete
var prePositionNotifications = function (notifications) {
[2653] Fix | Delete
each(notifications, function (notification) {
[2654] Fix | Delete
notification.moveTo(0, 0);
[2655] Fix | Delete
});
[2656] Fix | Delete
};
[2657] Fix | Delete
var positionNotifications = function (notifications) {
[2658] Fix | Delete
if (notifications.length > 0) {
[2659] Fix | Delete
var firstItem = notifications.slice(0, 1)[0];
[2660] Fix | Delete
var container = getEditorContainer(editor);
[2661] Fix | Delete
firstItem.moveRel(container, 'tc-tc');
[2662] Fix | Delete
each(notifications, function (notification, index) {
[2663] Fix | Delete
if (index > 0) {
[2664] Fix | Delete
notification.moveRel(notifications[index - 1].getEl(), 'bc-tc');
[2665] Fix | Delete
}
[2666] Fix | Delete
});
[2667] Fix | Delete
}
[2668] Fix | Delete
};
[2669] Fix | Delete
var reposition = function (notifications) {
[2670] Fix | Delete
prePositionNotifications(notifications);
[2671] Fix | Delete
positionNotifications(notifications);
[2672] Fix | Delete
};
[2673] Fix | Delete
var open = function (args, closeCallback) {
[2674] Fix | Delete
var extendedArgs = global$4.extend(args, { maxWidth: getContainerWidth() });
[2675] Fix | Delete
var notif = new Notification(extendedArgs);
[2676] Fix | Delete
notif.args = extendedArgs;
[2677] Fix | Delete
if (extendedArgs.timeout > 0) {
[2678] Fix | Delete
notif.timer = setTimeout(function () {
[2679] Fix | Delete
notif.close();
[2680] Fix | Delete
closeCallback();
[2681] Fix | Delete
}, extendedArgs.timeout);
[2682] Fix | Delete
}
[2683] Fix | Delete
notif.on('close', function () {
[2684] Fix | Delete
closeCallback();
[2685] Fix | Delete
});
[2686] Fix | Delete
notif.renderTo();
[2687] Fix | Delete
return notif;
[2688] Fix | Delete
};
[2689] Fix | Delete
var close = function (notification) {
[2690] Fix | Delete
notification.close();
[2691] Fix | Delete
};
[2692] Fix | Delete
var getArgs = function (notification) {
[2693] Fix | Delete
return notification.args;
[2694] Fix | Delete
};
[2695] Fix | Delete
return {
[2696] Fix | Delete
open: open,
[2697] Fix | Delete
close: close,
[2698] Fix | Delete
reposition: reposition,
[2699] Fix | Delete
getArgs: getArgs
[2700] Fix | Delete
};
[2701] Fix | Delete
}
[2702] Fix | Delete
[2703] Fix | Delete
function getDocumentSize(doc) {
[2704] Fix | Delete
var documentElement, body, scrollWidth, clientWidth;
[2705] Fix | Delete
var offsetWidth, scrollHeight, clientHeight, offsetHeight;
[2706] Fix | Delete
var max = Math.max;
[2707] Fix | Delete
documentElement = doc.documentElement;
[2708] Fix | Delete
body = doc.body;
[2709] Fix | Delete
scrollWidth = max(documentElement.scrollWidth, body.scrollWidth);
[2710] Fix | Delete
clientWidth = max(documentElement.clientWidth, body.clientWidth);
[2711] Fix | Delete
offsetWidth = max(documentElement.offsetWidth, body.offsetWidth);
[2712] Fix | Delete
scrollHeight = max(documentElement.scrollHeight, body.scrollHeight);
[2713] Fix | Delete
clientHeight = max(documentElement.clientHeight, body.clientHeight);
[2714] Fix | Delete
offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);
[2715] Fix | Delete
return {
[2716] Fix | Delete
width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,
[2717] Fix | Delete
height: scrollHeight < offsetHeight ? clientHeight : scrollHeight
[2718] Fix | Delete
};
[2719] Fix | Delete
}
[2720] Fix | Delete
function updateWithTouchData(e) {
[2721] Fix | Delete
var keys, i;
[2722] Fix | Delete
if (e.changedTouches) {
[2723] Fix | Delete
keys = 'screenX screenY pageX pageY clientX clientY'.split(' ');
[2724] Fix | Delete
for (i = 0; i < keys.length; i++) {
[2725] Fix | Delete
e[keys[i]] = e.changedTouches[0][keys[i]];
[2726] Fix | Delete
}
[2727] Fix | Delete
}
[2728] Fix | Delete
}
[2729] Fix | Delete
function DragHelper (id, settings) {
[2730] Fix | Delete
var $eventOverlay;
[2731] Fix | Delete
var doc = settings.document || domGlobals.document;
[2732] Fix | Delete
var downButton;
[2733] Fix | Delete
var start, stop, drag, startX, startY;
[2734] Fix | Delete
settings = settings || {};
[2735] Fix | Delete
var handleElement = doc.getElementById(settings.handle || id);
[2736] Fix | Delete
start = function (e) {
[2737] Fix | Delete
var docSize = getDocumentSize(doc);
[2738] Fix | Delete
var handleElm, cursor;
[2739] Fix | Delete
updateWithTouchData(e);
[2740] Fix | Delete
e.preventDefault();
[2741] Fix | Delete
downButton = e.button;
[2742] Fix | Delete
handleElm = handleElement;
[2743] Fix | Delete
startX = e.screenX;
[2744] Fix | Delete
startY = e.screenY;
[2745] Fix | Delete
if (domGlobals.window.getComputedStyle) {
[2746] Fix | Delete
cursor = domGlobals.window.getComputedStyle(handleElm, null).getPropertyValue('cursor');
[2747] Fix | Delete
} else {
[2748] Fix | Delete
cursor = handleElm.runtimeStyle.cursor;
[2749] Fix | Delete
}
[2750] Fix | Delete
$eventOverlay = global$7('<div></div>').css({
[2751] Fix | Delete
position: 'absolute',
[2752] Fix | Delete
top: 0,
[2753] Fix | Delete
left: 0,
[2754] Fix | Delete
width: docSize.width,
[2755] Fix | Delete
height: docSize.height,
[2756] Fix | Delete
zIndex: 2147483647,
[2757] Fix | Delete
opacity: 0.0001,
[2758] Fix | Delete
cursor: cursor
[2759] Fix | Delete
}).appendTo(doc.body);
[2760] Fix | Delete
global$7(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop);
[2761] Fix | Delete
settings.start(e);
[2762] Fix | Delete
};
[2763] Fix | Delete
drag = function (e) {
[2764] Fix | Delete
updateWithTouchData(e);
[2765] Fix | Delete
if (e.button !== downButton) {
[2766] Fix | Delete
return stop(e);
[2767] Fix | Delete
}
[2768] Fix | Delete
e.deltaX = e.screenX - startX;
[2769] Fix | Delete
e.deltaY = e.screenY - startY;
[2770] Fix | Delete
e.preventDefault();
[2771] Fix | Delete
settings.drag(e);
[2772] Fix | Delete
};
[2773] Fix | Delete
stop = function (e) {
[2774] Fix | Delete
updateWithTouchData(e);
[2775] Fix | Delete
global$7(doc).off('mousemove touchmove', drag).off('mouseup touchend', stop);
[2776] Fix | Delete
$eventOverlay.remove();
[2777] Fix | Delete
if (settings.stop) {
[2778] Fix | Delete
settings.stop(e);
[2779] Fix | Delete
}
[2780] Fix | Delete
};
[2781] Fix | Delete
this.destroy = function () {
[2782] Fix | Delete
global$7(handleElement).off();
[2783] Fix | Delete
};
[2784] Fix | Delete
global$7(handleElement).on('mousedown touchstart', start);
[2785] Fix | Delete
}
[2786] Fix | Delete
[2787] Fix | Delete
var global$b = tinymce.util.Tools.resolve('tinymce.ui.Factory');
[2788] Fix | Delete
[2789] Fix | Delete
var hasTabstopData = function (elm) {
[2790] Fix | Delete
return elm.getAttribute('data-mce-tabstop') ? true : false;
[2791] Fix | Delete
};
[2792] Fix | Delete
function KeyboardNavigation (settings) {
[2793] Fix | Delete
var root = settings.root;
[2794] Fix | Delete
var focusedElement, focusedControl;
[2795] Fix | Delete
function isElement(node) {
[2796] Fix | Delete
return node && node.nodeType === 1;
[2797] Fix | Delete
}
[2798] Fix | Delete
try {
[2799] Fix | Delete
focusedElement = domGlobals.document.activeElement;
[2800] Fix | Delete
} catch (ex) {
[2801] Fix | Delete
focusedElement = domGlobals.document.body;
[2802] Fix | Delete
}
[2803] Fix | Delete
focusedControl = root.getParentCtrl(focusedElement);
[2804] Fix | Delete
function getRole(elm) {
[2805] Fix | Delete
elm = elm || focusedElement;
[2806] Fix | Delete
if (isElement(elm)) {
[2807] Fix | Delete
return elm.getAttribute('role');
[2808] Fix | Delete
}
[2809] Fix | Delete
return null;
[2810] Fix | Delete
}
[2811] Fix | Delete
function getParentRole(elm) {
[2812] Fix | Delete
var role, parent = elm || focusedElement;
[2813] Fix | Delete
while (parent = parent.parentNode) {
[2814] Fix | Delete
if (role = getRole(parent)) {
[2815] Fix | Delete
return role;
[2816] Fix | Delete
}
[2817] Fix | Delete
}
[2818] Fix | Delete
}
[2819] Fix | Delete
function getAriaProp(name) {
[2820] Fix | Delete
var elm = focusedElement;
[2821] Fix | Delete
if (isElement(elm)) {
[2822] Fix | Delete
return elm.getAttribute('aria-' + name);
[2823] Fix | Delete
}
[2824] Fix | Delete
}
[2825] Fix | Delete
function isTextInputElement(elm) {
[2826] Fix | Delete
var tagName = elm.tagName.toUpperCase();
[2827] Fix | Delete
return tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT';
[2828] Fix | Delete
}
[2829] Fix | Delete
function canFocus(elm) {
[2830] Fix | Delete
if (isTextInputElement(elm) && !elm.hidden) {
[2831] Fix | Delete
return true;
[2832] Fix | Delete
}
[2833] Fix | Delete
if (hasTabstopData(elm)) {
[2834] Fix | Delete
return true;
[2835] Fix | Delete
}
[2836] Fix | Delete
if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(getRole(elm))) {
[2837] Fix | Delete
return true;
[2838] Fix | Delete
}
[2839] Fix | Delete
return false;
[2840] Fix | Delete
}
[2841] Fix | Delete
function getFocusElements(elm) {
[2842] Fix | Delete
var elements = [];
[2843] Fix | Delete
function collect(elm) {
[2844] Fix | Delete
if (elm.nodeType !== 1 || elm.style.display === 'none' || elm.disabled) {
[2845] Fix | Delete
return;
[2846] Fix | Delete
}
[2847] Fix | Delete
if (canFocus(elm)) {
[2848] Fix | Delete
elements.push(elm);
[2849] Fix | Delete
}
[2850] Fix | Delete
for (var i = 0; i < elm.childNodes.length; i++) {
[2851] Fix | Delete
collect(elm.childNodes[i]);
[2852] Fix | Delete
}
[2853] Fix | Delete
}
[2854] Fix | Delete
collect(elm || root.getEl());
[2855] Fix | Delete
return elements;
[2856] Fix | Delete
}
[2857] Fix | Delete
function getNavigationRoot(targetControl) {
[2858] Fix | Delete
var navigationRoot, controls;
[2859] Fix | Delete
targetControl = targetControl || focusedControl;
[2860] Fix | Delete
controls = targetControl.parents().toArray();
[2861] Fix | Delete
controls.unshift(targetControl);
[2862] Fix | Delete
for (var i = 0; i < controls.length; i++) {
[2863] Fix | Delete
navigationRoot = controls[i];
[2864] Fix | Delete
if (navigationRoot.settings.ariaRoot) {
[2865] Fix | Delete
break;
[2866] Fix | Delete
}
[2867] Fix | Delete
}
[2868] Fix | Delete
return navigationRoot;
[2869] Fix | Delete
}
[2870] Fix | Delete
function focusFirst(targetControl) {
[2871] Fix | Delete
var navigationRoot = getNavigationRoot(targetControl);
[2872] Fix | Delete
var focusElements = getFocusElements(navigationRoot.getEl());
[2873] Fix | Delete
if (navigationRoot.settings.ariaRemember && 'lastAriaIndex' in navigationRoot) {
[2874] Fix | Delete
moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements);
[2875] Fix | Delete
} else {
[2876] Fix | Delete
moveFocusToIndex(0, focusElements);
[2877] Fix | Delete
}
[2878] Fix | Delete
}
[2879] Fix | Delete
function moveFocusToIndex(idx, elements) {
[2880] Fix | Delete
if (idx < 0) {
[2881] Fix | Delete
idx = elements.length - 1;
[2882] Fix | Delete
} else if (idx >= elements.length) {
[2883] Fix | Delete
idx = 0;
[2884] Fix | Delete
}
[2885] Fix | Delete
if (elements[idx]) {
[2886] Fix | Delete
elements[idx].focus();
[2887] Fix | Delete
}
[2888] Fix | Delete
return idx;
[2889] Fix | Delete
}
[2890] Fix | Delete
function moveFocus(dir, elements) {
[2891] Fix | Delete
var idx = -1;
[2892] Fix | Delete
var navigationRoot = getNavigationRoot();
[2893] Fix | Delete
elements = elements || getFocusElements(navigationRoot.getEl());
[2894] Fix | Delete
for (var i = 0; i < elements.length; i++) {
[2895] Fix | Delete
if (elements[i] === focusedElement) {
[2896] Fix | Delete
idx = i;
[2897] Fix | Delete
}
[2898] Fix | Delete
}
[2899] Fix | Delete
idx += dir;
[2900] Fix | Delete
navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements);
[2901] Fix | Delete
}
[2902] Fix | Delete
function left() {
[2903] Fix | Delete
var parentRole = getParentRole();
[2904] Fix | Delete
if (parentRole === 'tablist') {
[2905] Fix | Delete
moveFocus(-1, getFocusElements(focusedElement.parentNode));
[2906] Fix | Delete
} else if (focusedControl.parent().submenu) {
[2907] Fix | Delete
cancel();
[2908] Fix | Delete
} else {
[2909] Fix | Delete
moveFocus(-1);
[2910] Fix | Delete
}
[2911] Fix | Delete
}
[2912] Fix | Delete
function right() {
[2913] Fix | Delete
var role = getRole(), parentRole = getParentRole();
[2914] Fix | Delete
if (parentRole === 'tablist') {
[2915] Fix | Delete
moveFocus(1, getFocusElements(focusedElement.parentNode));
[2916] Fix | Delete
} else if (role === 'menuitem' && parentRole === 'menu' && getAriaProp('haspopup')) {
[2917] Fix | Delete
enter();
[2918] Fix | Delete
} else {
[2919] Fix | Delete
moveFocus(1);
[2920] Fix | Delete
}
[2921] Fix | Delete
}
[2922] Fix | Delete
function up() {
[2923] Fix | Delete
moveFocus(-1);
[2924] Fix | Delete
}
[2925] Fix | Delete
function down() {
[2926] Fix | Delete
var role = getRole(), parentRole = getParentRole();
[2927] Fix | Delete
if (role === 'menuitem' && parentRole === 'menubar') {
[2928] Fix | Delete
enter();
[2929] Fix | Delete
} else if (role === 'button' && getAriaProp('haspopup')) {
[2930] Fix | Delete
enter({ key: 'down' });
[2931] Fix | Delete
} else {
[2932] Fix | Delete
moveFocus(1);
[2933] Fix | Delete
}
[2934] Fix | Delete
}
[2935] Fix | Delete
function tab(e) {
[2936] Fix | Delete
var parentRole = getParentRole();
[2937] Fix | Delete
if (parentRole === 'tablist') {
[2938] Fix | Delete
var elm = getFocusElements(focusedControl.getEl('body'))[0];
[2939] Fix | Delete
if (elm) {
[2940] Fix | Delete
elm.focus();
[2941] Fix | Delete
}
[2942] Fix | Delete
} else {
[2943] Fix | Delete
moveFocus(e.shiftKey ? -1 : 1);
[2944] Fix | Delete
}
[2945] Fix | Delete
}
[2946] Fix | Delete
function cancel() {
[2947] Fix | Delete
focusedControl.fire('cancel');
[2948] Fix | Delete
}
[2949] Fix | Delete
function enter(aria) {
[2950] Fix | Delete
aria = aria || {};
[2951] Fix | Delete
focusedControl.fire('click', {
[2952] Fix | Delete
target: focusedElement,
[2953] Fix | Delete
aria: aria
[2954] Fix | Delete
});
[2955] Fix | Delete
}
[2956] Fix | Delete
root.on('keydown', function (e) {
[2957] Fix | Delete
function handleNonTabOrEscEvent(e, handler) {
[2958] Fix | Delete
if (isTextInputElement(focusedElement) || hasTabstopData(focusedElement)) {
[2959] Fix | Delete
return;
[2960] Fix | Delete
}
[2961] Fix | Delete
if (getRole(focusedElement) === 'slider') {
[2962] Fix | Delete
return;
[2963] Fix | Delete
}
[2964] Fix | Delete
if (handler(e) !== false) {
[2965] Fix | Delete
e.preventDefault();
[2966] Fix | Delete
}
[2967] Fix | Delete
}
[2968] Fix | Delete
if (e.isDefaultPrevented()) {
[2969] Fix | Delete
return;
[2970] Fix | Delete
}
[2971] Fix | Delete
switch (e.keyCode) {
[2972] Fix | Delete
case 37:
[2973] Fix | Delete
handleNonTabOrEscEvent(e, left);
[2974] Fix | Delete
break;
[2975] Fix | Delete
case 39:
[2976] Fix | Delete
handleNonTabOrEscEvent(e, right);
[2977] Fix | Delete
break;
[2978] Fix | Delete
case 38:
[2979] Fix | Delete
handleNonTabOrEscEvent(e, up);
[2980] Fix | Delete
break;
[2981] Fix | Delete
case 40:
[2982] Fix | Delete
handleNonTabOrEscEvent(e, down);
[2983] Fix | Delete
break;
[2984] Fix | Delete
case 27:
[2985] Fix | Delete
cancel();
[2986] Fix | Delete
break;
[2987] Fix | Delete
case 14:
[2988] Fix | Delete
case 13:
[2989] Fix | Delete
case 32:
[2990] Fix | Delete
handleNonTabOrEscEvent(e, enter);
[2991] Fix | Delete
break;
[2992] Fix | Delete
case 9:
[2993] Fix | Delete
tab(e);
[2994] Fix | Delete
e.preventDefault();
[2995] Fix | Delete
break;
[2996] Fix | Delete
}
[2997] Fix | Delete
});
[2998] Fix | Delete
root.on('focusin', function (e) {
[2999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function