Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Update widget_prompt.md (#8283)
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Harper <[email protected]>
  • Loading branch information
magehardik and keharper authored Dec 18, 2020
1 parent 533bac3 commit 97998f2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/guides/v2.3/javascript-dev-guide/widgets/widget_prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The prompt widget can be initialized with or without binding to a certain elemen

```javascript
$('#prompt_init').prompt({
title: 'Prompt title',
title: $.mage.__('Prompt title'),
actions: {
confirm: function(){}, //callback on 'Ok' button click
cancel: function(){}, //callback on 'Cancel' button click
Expand All @@ -33,12 +33,13 @@ $('#prompt_init').prompt({

```javascript
require([
'jquery',
'Magento_Ui/js/modal/prompt'
], function(prompt) { // Variable that represents the `prompt` function
], function($, prompt) { // Variable that represents the `prompt` function

prompt({
title: 'Some title',
content: 'Some content',
title: $.mage.__('Some title'),
content: $.mage.__('Some content'),
actions: {
confirm: function(){},
cancel: function(){},
Expand Down Expand Up @@ -223,9 +224,9 @@ The prompt widget implements the following events:
'use strict';
$('.prompt-modal-content').prompt({
title: 'Prompt Title',
title: $.mage.__('Prompt Title'),
modalClass: 'prompt',
value: 'Value by default',
value: $.mage.__('Value by default'),
validation: true,
promptField: '[data-role="promptField"]',
validationRules: ['required-entry'],
Expand Down Expand Up @@ -269,10 +270,10 @@ The prompt widget implements the following events:
'use strict';
prompt({
title: 'Prompt Title',
content: $('.prompt-modal-content'),
title: $.mage.__('Prompt Title'),
content: $.mage.__($('.prompt-modal-content')),
modalClass: 'prompt',
value: 'Value by default',
value: $.mage.__('Value by default'),
validation: true,
promptField: '[data-role="promptField"]',
validationRules: ['required-entry'],
Expand Down

0 comments on commit 97998f2

Please sign in to comment.