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

feat: add readonly option #84

Merged
merged 1 commit into from
Nov 8, 2018
Merged

feat: add readonly option #84

merged 1 commit into from
Nov 8, 2018

Conversation

DKirwan
Copy link

@DKirwan DKirwan commented Nov 7, 2018

Hi!

We've been using CodeFlask in a web application and came across a use case where we just wanted to display a snippet of code for users to view and/or copy to their clipboard. We thought that this use case would be common for other developers also, so decided to share our changes.

I've added a readonly option. It sets the built-in html readonly attribute on the textarea so it is accessible by default.

@kazzkiq kazzkiq merged commit 75977be into kazzkiq:master Nov 8, 2018
@kazzkiq
Copy link
Owner

kazzkiq commented Nov 8, 2018

Great, thanks!

This approach allows to set if its readonly or not only at startup, right?

It would be interesting if we could also add functions to enable/disable readonly mode programatically.

Pretty much like @imdanielsp proposed in #74.

@imdanielsp do you mind if I close your PR so we can create a new PR using both approaches (this PR and the code you proposed in #74)?

@DKirwan
Copy link
Author

DKirwan commented Nov 8, 2018

Correct, @kazzkiq. It can only be set at startup.

Thanks for merging. If you want me to help with enabling/disabling the code programmatically just let me know.

Would it be possible to cut a release with this change so we can install it via npm?

@kazzkiq
Copy link
Owner

kazzkiq commented Nov 9, 2018

@DKirwan would you, please?

As soon as we have enabling/disabling functions for this feat I will make a new release.

@DKirwan
Copy link
Author

DKirwan commented Nov 9, 2018

Sure thing!

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

Successfully merging this pull request may close these issues.

None yet

2 participants