Sha256: a8a85e5830591ee7789cb8ca18212fc365b50ec148c52d58ad674189a977c7e2

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 KB

Contents

;(function($) {

	$.noty.layouts.centerRight = {
		name: 'centerRight',
		options: { // overrides options
			
		},
		container: {
			object: '<ul id="noty_centerRight_layout_container" />',
			selector: 'ul#noty_centerRight_layout_container',
			style: function() {
				$(this).css({
					right: 20,
					position: 'fixed',
					width: '310px',
					height: 'auto',
					margin: 0,
					padding: 0,
					listStyleType: 'none',
					zIndex: 10000000
				});

				// getting hidden height
				var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
				$("body").append(dupe);
				dupe.find('.i-am-closing-now').remove();
				dupe.find('li').css('display', 'block');
				var actual_height = dupe.height();
				dupe.remove();

				if ($(this).hasClass('i-am-new')) {
					$(this).css({
						top: ($(window).height() - actual_height) / 2 + 'px',
					});
				} else {
					$(this).animate({
						top: ($(window).height() - actual_height) / 2 + 'px'
					}, 500);
				}

				if (window.innerWidth < 600) {
					$(this).css({
						right: 5
					});
				}
				
			}
		},
		parent: {
			object: '<li />',
			selector: 'li',
			css: {}
		},
		css: {
			display: 'none',
			width: '310px'
		},
		addClass: ''
	};

})(jQuery);

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
noty-rails-2.0.3.1 vendor/assets/javascripts/noty/layouts/centerRight.js
noty-rails-2.0.3 vendor/assets/javascripts/noty/layouts/centerRight.js