Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options.text vs options.verifyLabel #73

Closed
zeroedin opened this issue Jul 31, 2019 · 1 comment
Closed

options.text vs options.verifyLabel #73

zeroedin opened this issue Jul 31, 2019 · 1 comment

Comments

@zeroedin
Copy link

options.text is added to modal as follows:

$.each((options.text||'').split(/\n{2}/), function (i, piece) {
  body.append($('<p/>').html(piece));
});

However options.verifyLabel is added like:

if (options.verifyLabel)
  body.append($('<p>', {text: options.verifyLabel}))

Could both of these inserts be normalized? I am trying to add a class wrapper around some text in these inserted paragraphs to word break their content as my file names tend to be long and I'd rather not make the modal bigger if possible, instead just word breaking using css. If possible I'd like to do this specifically on file name rather then targeting the parent paragraph, as I don't want the the paragraphs to break on less long words.

confirm: "Are you sure you want to delete <span class='confirm-filename'>`#{file.filename}`</span>?  This is a permanent action an can not be undone.",
verify: "#{entity.filename}",
verify_text: "Type <span class='confirm-filename'>`#{file.filename}`</span> to confirm"},`

Could be fixed by using .html() instead of .. {text: 'options.verifyLabel'}

$.each((options.text||'').split(/\n{2}/), function (i, piece) {
  body.append($('<p/>').html(piece));
});

if (options.verifyLabel)
  body.append($('<p>').html(options.verifyLabel))

Let me know if there is any issues with this approach?

@zeroedin
Copy link
Author

Closing this issue, just realized i could eliminate my usage of the verify text and do this:

confirm: "Are you sure you want to delete <span>`#{file.filename}`</span>? \n\n Type <span>`#{file.filename}`</span> to confirm \n\n <strong>This is a permanent action and can not be undone.</strong>",

It does however bring up another issue. Should verifyText create a <label> instead of a <p> tag? I'll open a separate issue for that #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant