Mercurial Hosting > sceditor
comparison src/sceditor.js @ 31:4eae156ca604
remove autoExpandThrottle
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 13 Aug 2022 21:40:40 -0600 |
parents | db061869f28f |
children | 98f11d0cbbd8 |
comparison
equal
deleted
inserted
replaced
30:db061869f28f | 31:4eae156ca604 |
---|---|
4352 * @private | 4352 * @private |
4353 */ | 4353 */ |
4354 var autoExpandBounds; | 4354 var autoExpandBounds; |
4355 | 4355 |
4356 /** | 4356 /** |
4357 * Timeout for the autoExpand function to throttle calls | |
4358 * | |
4359 * @private | |
4360 */ | |
4361 var autoExpandThrottle; | |
4362 | |
4363 /** | |
4364 * Cache of the current toolbar buttons | 4357 * Cache of the current toolbar buttons |
4365 * | 4358 * |
4366 * @type {Object} | 4359 * @type {Object} |
4367 * @private | 4360 * @private |
4368 */ | 4361 */ |
5364 | 5357 |
5365 return base; | 5358 return base; |
5366 }; | 5359 }; |
5367 | 5360 |
5368 autoExpand = function () { | 5361 autoExpand = function () { |
5369 if (options.autoExpand && !autoExpandThrottle) { | 5362 if (options.autoExpand) { |
5370 autoExpandThrottle = setTimeout(base.expandToContent, 200); | 5363 base.expandToContent(); |
5371 } | 5364 } |
5372 }; | 5365 }; |
5373 | 5366 |
5374 /** | 5367 /** |
5375 * Expands or shrinks the editors height to the height of it's content | 5368 * Expands or shrinks the editors height to the height of it's content |
5386 */ | 5379 */ |
5387 base.expandToContent = function (ignoreMaxHeight) { | 5380 base.expandToContent = function (ignoreMaxHeight) { |
5388 if (base.maximize()) { | 5381 if (base.maximize()) { |
5389 return; | 5382 return; |
5390 } | 5383 } |
5391 | |
5392 clearTimeout(autoExpandThrottle); | |
5393 autoExpandThrottle = false; | |
5394 | 5384 |
5395 if (!autoExpandBounds) { | 5385 if (!autoExpandBounds) { |
5396 var height$1 = options.resizeMinHeight || options.height || | 5386 var height$1 = options.resizeMinHeight || options.height || |
5397 height(original); | 5387 height(original); |
5398 | 5388 |