ForgeKomponenty
cs

Komponenty

j-NotificationsPanel

jComponent 20 · jcomponent@20 component Příklad načten s jComponent 20
  • singleton
  • Naučte se z příkladu

Konfigurace:

  • top {Number} top offset (předvolený: 0)
  • visibleY {Boolean} ukazuje Y scrollbars (předvolené: true)
  • Titul title {String} v panelu oznámení (předvolený: Notifications)
  • autoremove {Boolean} odstraňuje oznámení po kliknutí na něj (předvolené: true)
  • click {String} je cesta k metodu function(obj, el) když uživatel klikne na oznámení
  • exec {String} je cesta k metodu function(render(ARR_OF_OBJECT)) když uživatel chce zobrazit oznámení

Použijte ji s <ui-component name="notificationspanel">Pokud je součástka ještě nezačleněna, jComponent Stáhnout ji na první použití z adresy DEF.fallback a) The Componentator CDN dle předvolby. autor: Peter Širka. zdroj: Componentator Výrobce je autorizován, MIT licence.

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>