You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Or you can manually create a new notice with Svelte's component API (if you know what you're doing):
301
-
302
-
```js
303
-
newPNotify({
304
-
target:document.body,
305
-
data: {
306
-
text:"I'm an alert.",
307
-
type:'notice'
308
-
}
309
-
});
310
-
```
311
-
312
299
# Options
313
300
314
301
PNotify options and default values.
@@ -438,20 +425,6 @@ PNotify.defaults.modules = {
438
425
439
426
`}`
440
427
441
-
> :information_source: In v4, it's no longer possible to show closer/sticker buttons when the notice is nonblocking.
442
-
443
-
## NonBlock Module
444
-
445
-
Requires [NonBlock.js](https://github.com/sciactive/nonblockjs) 1.0.8 or higher.
446
-
447
-
**It is also deprecated and unnecessary in v4.** All it does is add the 'nonblock' class to your notice. You can do the same yourself with `addClass: 'nonblock'`.
448
-
449
-
`NonBlock: {`
450
-
*`nonblock: false`<br>
451
-
Use NonBlock.js to create a non-blocking notice. It lets the user click elements underneath it.
452
-
453
-
`}`
454
-
455
428
## Mobile Module
456
429
457
430
`Mobile: {`
@@ -600,12 +573,8 @@ The callback options all expect the value to be a callback function. If the func
600
573
Create a notice with 'error' type.
601
574
*`PNotify.closeAll()`<br>
602
575
Close all notices.
603
-
*`PNotify.removeAll()`<br>
604
-
Alias for closeAll(). (Deprecated)
605
576
*`PNotify.closeStack(stack)`<br>
606
577
Close all the notices in a stack.
607
-
*`PNotify.removeStack(stack)`<br>
608
-
Alias for closeStack(stack). (Deprecated)
609
578
*`PNotify.positionAll()`<br>
610
579
Reposition all notices.
611
580
*`PNotify.VERSION`<br>
@@ -617,18 +586,18 @@ The callback options all expect the value to be a callback function. If the func
617
586
*`PNotify.notices`<br>
618
587
An array of all active notices.
619
588
*`PNotify.modules`<br>
620
-
This object holds all the PNotify modules.
621
-
*`PNotify.styling`<br>
622
-
Styling objects.
589
+
This object holds all the PNotify module constructors.
590
+
*`PNotify.styles`<br>
591
+
Styles objects.
592
+
*`PNotify.icons`<br>
593
+
Icons objects.
623
594
624
595
# Instance Methods and Properties
625
596
626
597
*`notice.open()`<br>
627
598
Open the notice.
628
599
*`notice.close()`<br>
629
600
Close the notice.
630
-
*`notice.remove()`<br>
631
-
Alias for close(). (Deprecated)
632
601
*`notice.update(options)`<br>
633
602
Update the notice with new options.
634
603
*`notice.addModuleClass(...classNames)`<br>
@@ -650,19 +619,15 @@ The callback options all expect the value to be a callback function. If the func
650
619
651
620
## From the [Svelte Component API](https://svelte.technology/guide#component-api)
652
621
653
-
*`notice.get(option)`<br>
654
-
Get the value of an option.
655
-
*`notice.set(options)`<br>
656
-
You probably want to use `update(options)` instead. It has some special PNotify secret sauce to make sure your notice doesn't break.
657
-
*`notice.observe(key, callback[, options])`<br>
658
-
Observe an option. See the Svelte docs for more info.
659
-
*`notice.destroy()`<br>
660
-
Removes the component from the DOM and any observers/event listeners. You probably want to use `close()` instead. It will animate the notice out and you can open it again. Once you destroy it, you can't open it again.
622
+
*`notice.$set(options)`<br>
623
+
You probably want to use `update(options)` instead. The Svelte API may change.
624
+
*`notice.$destroy()`<br>
625
+
Removes the component from the DOM and any observers/event listeners. You probably want to use `close()` with `destroy: true` instead. It will animate the notice out.
661
626
662
627
## Events
663
628
664
629
*`notice.on(eventName, callback)`<br>
665
-
Assign a callback to an event. Callback receives an `event` argument.
630
+
Assign a callback to an event. Callback receives an `event` argument with a `detail` prop.
text: 'I\'m a special kind of notice called "non-blocking". When you hover over me I\'ll fade to show the elements underneath. Feel free to click any of them just like I wasn\'t even here.\n\nNote: HTML links don\'t trigger in some very old browsers, due to security settings.',
409
+
addClass: 'nonblock'
410
+
});
411
+
">Using NonBlock.js</button><small>(Click through to things underneath the notice.)</small>
@@ -993,28 +1004,6 @@ <h5 class="card-header">Buttons Module <small>Sticker and a closer buttons.</sma
993
1004
">Close Permanotice</button>
994
1005
</div>
995
1006
996
-
<h5class="card-header">NonBlock Module (Deprecated, Replaced with <ahref="https://github.com/sciactive/nonblockjs" target="_blank">NonBlock.js</a>) <small>Click through to things underneath the notice.</small></h5>
text: 'You can still use the NonBlock module, but all it does is add the "nonblock" class for you. You can do that yourself with "addClass: \'nonblock\'".',
text: 'I\'m a special kind of notice called "non-blocking". When you hover over me I\'ll fade to show the elements underneath. Feel free to click any of them just like I wasn\'t even here.\n\nNote: HTML links don\'t trigger in some browsers, due to security settings.',
1009
-
modules: {
1010
-
NonBlock: {
1011
-
nonblock: true
1012
-
}
1013
-
}
1014
-
});
1015
-
">Non-Blocking (The Old Way)</button>
1016
-
</div>
1017
-
1018
1007
<h5class="card-header">Mobile Module <small>Notices on mobile phones and tablets.</small></h5>
1019
1008
<divclass="card-body">
1020
1009
<divclass="alert alert-info">Since the Mobile module provides support by default, most of the demos on this page work on mobile.</div>
0 commit comments