Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

textarea

Questions related to using nuBuilder Forte.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: textarea

Unread post 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'));
			}
		});
	});
}
Last edited by kev1n on Fri Oct 25, 2019 3:55 pm, edited 1 time in total.
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: textarea

Unread post by johan »

Kevin
This works even better.
Thanks

Johan
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: textarea

Unread post by kev1n »

johan wrote:Kevin
This works even better.
Thanks

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