Page 2 of 2

Re: textarea

Posted: Thu Oct 24, 2019 12:06 pm
by kev1n
Here's a another (simpler) version that works without ResizeObserver and it should also be more performant.

Code: Select all

if (nuFormType() == 'edit') {
	
	var curIndex = 2;
	// Save initial textarea dimensions (height, width)
	$("textarea").each(function () {
		$(this).data('height', $(this).height()).data('width', $(this).width());
	});
	
	$("textarea").mousedown(function () {
		// Set the active textarea on top
		this.style.zIndex = ++curIndex;
		var t = this;
		// Restore dimensions of the other textareas
		$("textarea").each(function () {
			if(t !== this) {
				$(this).height($(this).data('height')).width($(this).data('width'));
			}
		});
	});
}

Re: textarea

Posted: Fri Oct 25, 2019 3:46 pm
by johan
Kevin
This works even better.
Thanks

Johan

Re: textarea

Posted: Fri Oct 25, 2019 9:42 pm
by kev1n
johan wrote:Kevin
This works even better.
Thanks

Johan
Yes, the 2nd version should be more performant :D