Skip to content

Instantly share code, notes, and snippets.

@vxsx
Created December 1, 2017 13:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vxsx/c8d982319b757bd91bd7d2071ce679af to your computer and use it in GitHub Desktop.
Save vxsx/c8d982319b757bd91bd7d2071ce679af to your computer and use it in GitHub Desktop.
close sideframe
{% block object-tools-items %}
{% if original.can_import_from_archive %} {% if original.can_import_from_archive %}
+ <script>
+ function closeSideframe() {
+ try {
+ window.top.CMS.$('.cms-sideframe-close').trigger('click.cms.sideframe');
+ } catch(e) {}
+ }
+ </script>
{% url 'admin:translation-request-adjust-import-data' original.pk as adjust_url %} {% url 'admin:translation-request-adjust-import-data' original.pk as adjust_url %}
- <li><a href="{{ adjust_url }}">{% trans "Adjust import data" %}</a></li> + <li><a target="_top" onclick="closeSideframe()" href="{{ adjust_url }}">{% trans "Adjust import data" %}</a></li>
{% url 'admin:translation-request-import-from-archive' original.pk as import_url %} {% url 'admin:translation-request-import-from-archive' original.pk as import_url %}
- <li><a href="{{ import_url }}">{% trans "Import from archive" %}</a></li> + <li><a target="_top" onclick="closeSideframe()" href="{{ import_url }}">{% trans "Import from archive" %}</a></li>
{% endif %} {% endif %}
{{ block.super }} {{ block.super }}
{% endblock %} {% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment