ForgeComponentes
pt

Componentes

j-NotificationsPanel

jComponent 20 · jcomponent@20 component Exemplo carregado com jComponent 20
  • Singularidade
  • Aprenda com o exemplo

Configuração:

  • top {Number} Offset superior (default: 0)
  • visibleY {Boolean} mostra Y scrollbars (default: true)
  • Título title {String} no painel de notificações (default: Notifications)
  • autoremove {Boolean} remove notificações depois de clicar nele (default: true)
  • click {String} um caminho para o método function(obj, el) quando o usuário clique nas notificações
  • exec {String} um caminho para o método function(render(ARR_OF_OBJECT)) quando o usuário quer mostrar as notificações

Use-o com <ui-component name="notificationspanel">Quando o componente ainda não está carregado, jComponent Descarrega-o no primeiro uso do endereço DEF.fallback (a partir do Componentator CDN por padrão). autor: Peter Širka. fonte: o Componentator Reserva de componentes, licença MIT.

example.html
<ui-component name="notificationspanel" path="shownotifications" config="exec:loadnotifications;click:clicknotificiation">
	<script type="text/html">
		<h2>{{ name }}</h2>
		<p>{{ body }}</p>
		<hr />
	</script>
</ui-component>

<script>

	var shownotifications = false;

	// Shows notifications panel after 2 seconds
	SET('shownotifications', true, 2000);

	// The method will be executed automatically before the notifications panel will be visible
	function loadnotifications(render) {
		var arr = [];
		arr.push({ name: 'Name of notifications 1', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos, architecto!' });
		arr.push({ name: 'Name of notifications 2', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos, architecto!' });
		arr.push({ name: 'Name of notifications 3', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos, architecto!' });

		// IMPORTANT:
		// This renders notifications onto notifications panel
		render(arr);
	}

	function clicknotificiation(obj) {
		console.log('CLICK', obj);
	}

</script>