Skip to content
Snippets Groups Projects
Commit 0eaa231a authored by Olimpia Magliulo's avatar Olimpia Magliulo
Browse files

Fix typo + update common javascript for clipboard.js

No need to have a postload for clipboard.js in templates.
Use the class "clipboard-btn" and match the data-clipboard-target with the right ID
(or other DOM-element).
parent 547058c5
No related branches found
No related tags found
No related merge requests found
{% set pagetitle = dictTitle | trans %} {% set pagetitle = dictTitle | trans %}
{% extends "base.twig" %} {% extends "base.twig" %}
{% block postload %}
<script type="text/javascript">
new Clipboard('.clipboard-btn');
</script>
{% endblock %}
{% block content %} {% block content %}
<h2>{{ dictTitle | trans }}</h2> <h2>{{ dictTitle | trans }}</h2>
{{ dictDescr | trans(parameters) }} {{ dictDescr | trans(parameters) }}
......
...@@ -39,12 +39,6 @@ function SimpleSAML_hide(id) { ...@@ -39,12 +39,6 @@ function SimpleSAML_hide(id) {
element.style.display = 'none'; element.style.display = 'none';
} }
function metadata(index) {
var clipboard = new Clipboard('#btn'+index);
console.log();
}
// Attach the `fileselect` event to all file inputs on the page // Attach the `fileselect` event to all file inputs on the page
$(document).on('change', ':file', function() { $(document).on('change', ':file', function() {
var input = $(this), var input = $(this),
...@@ -56,6 +50,7 @@ $(document).on('change', ':file', function() { ...@@ -56,6 +50,7 @@ $(document).on('change', ':file', function() {
$(document).ready(function() { $(document).ready(function() {
$('.language-menu').selectize(); $('.language-menu').selectize();
$('#organization').selectize(); $('#organization').selectize();
new Clipboard('.clipboard-btn');
// Watch for custom `fileselect` event // Watch for custom `fileselect` event
$(':file').on('fileselect', function(event, numFiles, label) { $(':file').on('fileselect', function(event, numFiles, label) {
...@@ -69,7 +64,7 @@ $(document).ready(function() { ...@@ -69,7 +64,7 @@ $(document).ready(function() {
if( log ) { if( log ) {
document.getElementById('show-file').innerHTML = log; document.getElementById('show-file').innerHTML = log;
} }
}; }
}); });
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment