Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafaznv committed Oct 9, 2024
2 parents a1e7501 + cafc121 commit 5076ac9
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* [Limit On Index](advanced-usage/ckeditor-field-options/limit-on-index.md)
* [Content Language](advanced-usage/ckeditor-field-options/content-language.md)
* [Force Paste as Plain Text](advanced-usage/ckeditor-field-options/force-page-as-plain-text.md)
* [Alert Before Unsaved Changes](advanced-usage/ckeditor-field-options/alert-before-unsaved-changes.md)
* [Text Part Language](advanced-usage/ckeditor-field-options/text-part-language.md)
* [General HTML Support](advanced-usage/ckeditor-field-options/general-html-support.md)
* [Group Items In Overflow Mode](advanced-usage/ckeditor-field-options/group-items-in-overflow-mode.md)
Expand All @@ -54,6 +55,7 @@
* [Options](advanced-usage/configuration/toolbars/toolbar-1/options.md)
* [Content Lang](advanced-usage/configuration/toolbars/toolbar-1/content-lang.md)
* [Force Past as Plain Text](advanced-usage/configuration/toolbars/toolbar-1/force-page-as-plain-text.md)
* [Alert Before Unsaved Changes](advanced-usage/configuration/toolbars/toolbar-1/alert-before-unsaved-changes.md)
* [UI Language](advanced-usage/configuration/toolbars/toolbar-1/ui-language/README.md)
* [UI Language Name](advanced-usage/configuration/toolbars/toolbar-1/ui-language/ui-language-name.md)
* [UI Language Script](advanced-usage/configuration/toolbars/toolbar-1/ui-language/ui-language-script.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
description: alertBeforeUnsavedChanges
---

# Alert Before Unsaved Changes

<table><thead><tr><th>Argument</th><th width="141">Type</th><th width="149" data-type="checkbox">Required</th><th>Default</th></tr></thead><tbody><tr><td>status</td><td>bool</td><td>false</td><td>true</td></tr></tbody></table>

This feature is enabled by default and triggers an alert if a user attempts to navigate away or refresh the page without saving CKEditor content, just like other form fields in Nova.





```php
use Mostafaznv\NovaCkEditor\CkEditor;

class Article extends Resource
{
public function fields(Request $request): array
{
return [
CkEditor::make(trans('Content'), 'content')
->alertBeforeUnsavedChanges()
];
}
}
```

{% hint style="info" %}
This feature has been available since <mark style="color:red;">v7.6.0</mark>
{% endhint %}



Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
description: toolbars.toolbar-1.alert-before-unsaved-changes
---

# Alert Before Unsaved Changes

<table><thead><tr><th width="390">Property Name</th><th width="152.33333333333331">Type</th><th>Default</th></tr></thead><tbody><tr><td>toolbars.toolbar-1.alert-before-unsaved-changes</td><td>bool</td><td>true</td></tr></tbody></table>

This feature is enabled by default and triggers an alert if a user attempts to navigate away or refresh the page without saving CKEditor content, just like other form fields in Nova.

if you’d rather disable this behavior, simply set <mark style="color:red;">`toolbars.toolbar-1.alert-before-unsaved-changes`</mark> to <mark style="color:red;">`false`</mark> in the configuration.



{% hint style="info" %}
This feature has been available since <mark style="color:red;">v7.6.0</mark>
{% endhint %}



0 comments on commit 5076ac9

Please sign in to comment.