And I was curious how to implement such behavior in my application. I have found that it is very easy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method='POST' target='preview-tab'> | |
<input type="hidden" name="path" value="{{ relative_file_path }}" /> | |
<input type="hidden" name="url" value="{{ request.path }}" /> | |
<textarea id='code' name='content'>{{ content }}</textarea> | |
</form> |
Usually for the target attribute the _blank value is used. It opens a new tab each time because actually it is a name of the new window. So rather than giving this default value, give a particular name like preview-tab. Then all the clicks should open the content in same window.
No comments:
Post a Comment