ep_subscript_and_superscript 0.2.32 → 0.2.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/locales/my.json +9 -0
- package/locales/sw.json +9 -0
- package/locales/th.json +9 -0
- package/package.json +1 -1
- package/static/js/index.js +6 -6
package/locales/my.json
ADDED
package/locales/sw.json
ADDED
package/locales/th.json
ADDED
package/package.json
CHANGED
package/static/js/index.js
CHANGED
|
@@ -22,22 +22,22 @@ exports.postAceInit = (hook, context) => {
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
exports.aceEditEvent = (
|
|
25
|
+
exports.aceEditEvent = (hookName, {callstack, editorInfo}) => {
|
|
26
26
|
// If it's not a click or a key event and the text hasn't changed then do nothing
|
|
27
|
-
if (!(
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
if (!(callstack.type === 'handleClick') &&
|
|
28
|
+
!(callstack.type === 'handleKeyEvent') &&
|
|
29
|
+
!(callstack.docTextChanged)) {
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
32
|
setTimeout(() => { // avoid race condition..
|
|
33
33
|
// the caret is in a new position.. Let's do some funky shit
|
|
34
|
-
if (
|
|
34
|
+
if (editorInfo.ace_getAttributeOnSelection('sub')) {
|
|
35
35
|
// show the button as being depressed.. Not sad, but active.. You know the drill bitches.
|
|
36
36
|
$('.subscript > a').addClass('activeButton');
|
|
37
37
|
} else {
|
|
38
38
|
$('.subscript > a').removeClass('activeButton');
|
|
39
39
|
}
|
|
40
|
-
if (
|
|
40
|
+
if (editorInfo.ace_getAttributeOnSelection('sup')) {
|
|
41
41
|
// show the button as being depressed.. Not sad, but active.. You know the drill bitches.
|
|
42
42
|
$('.superscript > a').addClass('activeButton');
|
|
43
43
|
} else {
|