Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

textarea

Questions related to using nuBuilder Forte.
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 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: 422
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: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 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