Rev 637 | Rev 759 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 637 | Rev 679 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. |
2 | * Copyright (c) Tiny Technologies, Inc. All rights reserved. |
3 | * Licensed under the LGPL or a commercial license. |
3 | * Licensed under the LGPL or a commercial license. |
4 | * For LGPL see License.txt in the project root for license information. |
4 | * For LGPL see License.txt in the project root for license information. |
5 | * For commercial licenses see https://www.tiny.cloud/ |
5 | * For commercial licenses see https://www.tiny.cloud/ |
6 | * |
6 | * |
7 | * Version: 5.9.2 (2021-09-08) |
7 | * Version: 5.10.2 (2021-11-17) |
8 | */ |
8 | */ |
9 | (function () { |
9 | (function () { |
10 | 'use strict'; |
10 | 'use strict'; |
11 | 11 | ||
12 | var Cell = function (initial) { |
12 | var Cell = function (initial) { |
Line 78... | Line 78... | ||
78 | }; |
78 | }; |
79 | var parseCssValueToInt = function (dom, elm, name, computed) { |
79 | var parseCssValueToInt = function (dom, elm, name, computed) { |
80 | var value = parseInt(dom.getStyle(elm, name, computed), 10); |
80 | var value = parseInt(dom.getStyle(elm, name, computed), 10); |
81 | return isNaN(value) ? 0 : value; |
81 | return isNaN(value) ? 0 : value; |
82 | }; |
82 | }; |
- | 83 | var shouldScrollIntoView = function (trigger) { |
|
- | 84 | if ((trigger === null || trigger === void 0 ? void 0 : trigger.type.toLowerCase()) === 'setcontent') { |
|
- | 85 | var setContentEvent = trigger; |
|
- | 86 | return setContentEvent.selection === true || setContentEvent.paste === true; |
|
- | 87 | } else { |
|
- | 88 | return false; |
|
- | 89 | } |
|
- | 90 | }; |
|
83 | var resize = function (editor, oldSize) { |
91 | var resize = function (editor, oldSize, trigger) { |
84 | var dom = editor.dom; |
92 | var dom = editor.dom; |
85 | var doc = editor.getDoc(); |
93 | var doc = editor.getDoc(); |
86 | if (!doc) { |
94 | if (!doc) { |
87 | return; |
95 | return; |
88 | } |
96 | } |
Line 119... | Line 127... | ||
119 | fireResizeEditor(editor); |
127 | fireResizeEditor(editor); |
120 | if (global$1.browser.isSafari() && global$1.mac) { |
128 | if (global$1.browser.isSafari() && global$1.mac) { |
121 | var win = editor.getWin(); |
129 | var win = editor.getWin(); |
122 | win.scrollTo(win.pageXOffset, win.pageYOffset); |
130 | win.scrollTo(win.pageXOffset, win.pageYOffset); |
123 | } |
131 | } |
124 | if (editor.hasFocus()) { |
132 | if (editor.hasFocus() && shouldScrollIntoView(trigger)) { |
125 | editor.selection.scrollIntoView(editor.selection.getNode()); |
133 | editor.selection.scrollIntoView(); |
126 | } |
134 | } |
127 | if (global$1.webkit && deltaSize < 0) { |
135 | if (global$1.webkit && deltaSize < 0) { |
128 | resize(editor, oldSize); |
136 | resize(editor, oldSize, trigger); |
129 | } |
137 | } |
130 | } |
138 | } |
131 | }; |
139 | }; |
132 | var setup = function (editor, oldSize) { |
140 | var setup = function (editor, oldSize) { |
133 | editor.on('init', function () { |
141 | editor.on('init', function () { |
Line 138... | Line 146... | ||
138 | 'paddingLeft': overflowPadding, |
146 | 'paddingLeft': overflowPadding, |
139 | 'paddingRight': overflowPadding, |
147 | 'paddingRight': overflowPadding, |
140 | 'min-height': 0 |
148 | 'min-height': 0 |
141 | }); |
149 | }); |
142 | }); |
150 | }); |
143 | editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function () { |
151 | editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function (e) { |
144 | resize(editor, oldSize); |
152 | resize(editor, oldSize, e); |
145 | }); |
153 | }); |
146 | if (shouldAutoResizeOnInit(editor)) { |
154 | if (shouldAutoResizeOnInit(editor)) { |
147 | editor.on('init', function () { |
155 | editor.on('init', function () { |
148 | wait(editor, oldSize, 20, 100, function () { |
156 | wait(editor, oldSize, 20, 100, function () { |
149 | wait(editor, oldSize, 5, 1000); |
157 | wait(editor, oldSize, 5, 1000); |