jquery-nice-select icon indicating copy to clipboard operation
jquery-nice-select copied to clipboard

List out of window

Open RedskyThirty opened this issue 7 years ago • 2 comments

May be this will help some guys. TODO: Manage "$(window).resize()"

` // Open/close $(document).on('click.nice_select', '.nice-select', function(event) { var $dropdown = $(this); var $list = $dropdown.find('.list'); // NEW LINE

		$('.nice-select').not($dropdown).removeClass('open');
		$dropdown.toggleClass('open');

		if ($dropdown.hasClass('open')) {
			$dropdown.find('.option');
			$dropdown.find('.focus').removeClass('focus');
			$dropdown.find('.selected').addClass('focus');

			// NEW LINES

			if($list.attr('style')) $list.removeAttr('style'); // Reset

			var maxHeight = ($(window).innerHeight() - $list.offset().top - 60); // "60" => spacing

			if($list.height() > maxHeight)
			{
				$list.css({
					'height': maxHeight,
					'overflow-y': 'auto',
					'-webkit-overflow-scrolling': 'touch'
				});
			}
		} else {
			$dropdown.focus();

			if($list.attr('style')) $list.removeAttr('style'); // NEW LINE
		}
	});

`

RedskyThirty avatar Oct 03 '18 10:10 RedskyThirty

Would you mind to send a PR ?

miagile avatar Oct 07 '18 06:10 miagile

Hello,

Sorry, I don't understand what you mean..?..

Manuel Piton Interactive developer +32 497 31 97 27 [callto:+32497319727]    •   [email protected] [mailto:[email protected]]

 

"Easy does it" is not part of our mindset. [email protected] [mailto:[email protected]]    •   www.redsky-thirty.be [http://www.redsky-thirty.be/] Chemin des Vallées de Roux, 31 - B-1457 Walhain-Saint-Paul

Le 07/10/2018 08:28:58, miagile [email protected] a écrit : Would you mind to send a PR ? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [https://github.com/hernansartorio/jquery-nice-select/issues/80#issuecomment-427629488], or mute the thread [https://github.com/notifications/unsubscribe-auth/ALF8_-BU51yKXCAicpA6VT2rB4FKjHbvks5uiZ8mgaJpZM4XFwba].

RedskyThirty avatar Oct 08 '18 05:10 RedskyThirty