Gitlab CSE Unil

Commit 13171f0e authored by M. Chardon's avatar M. Chardon
Browse files

activation automatique des boutons de la barre d'outil

parent d30e0621
...@@ -1664,21 +1664,6 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export ...@@ -1664,21 +1664,6 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
* @param toolName The name of the activated tool * @param toolName The name of the activated tool
*/ */
function onToolActivated(toolName) { function onToolActivated(toolName) {
// Ensure that the currently highlighted tool button correspond to the activated tool button.
// This is not the case if the tool is activated by the script and to by a click on the button.
// Change the states accordingly if needed
var currentButton = $("[data-tool-name]").filter("[checked=checked]");
var activatedButton = $("[data-tool-name=" + toolName + "]");
if (currentButton.get(0) !== activatedButton.get(0)) {
.prop( "checked", false )
// Update the cursor class of the canvas element // Update the cursor class of the canvas element
_canvas _canvas
.removeClass(function(i,className){ .removeClass(function(i,className){
...@@ -268,37 +268,37 @@ if (t === "light") { ...@@ -268,37 +268,37 @@ if (t === "light") {
<div class="btn-toolbar" role="toolbar" id="draw-tool-tb"> <div class="btn-toolbar" role="toolbar" id="draw-tool-tb">
<div class="btn-group-vertical btn-group-toggle" data-toggle="buttons"> <div class="btn-group-vertical btn-group-toggle" data-toggle="buttons">
{% block draw-tool-tb %} {% block draw-tool-tb %}
<label class="btn btn-lg btn-primary" title="Selection (A)"> <label class="btn btn-lg btn-primary active" title="Selection (A)">
<input type="radio" name="toolType" value="select" id="tool-select" data-tool-name="select"> <input type="radio" name="toolType" value="select" id="tool-select" data-tool-name="select" autocomplete="off" checked>
<span class="fa fa-mouse-pointer"></span><span class="tool-text"> Select</span> <span class="fa fa-mouse-pointer"></span><span class="tool-text"> Select</span>
</label> </label>
<label class="btn btn-lg btn-primary" title="Déplacement (Espace)"> <label class="btn btn-lg btn-primary" title="Déplacement (Espace)">
<input type="radio" name="toolType" value="pan" id="tool-pan" data-tool-name="pan"> <input type="radio" name="toolType" value="pan" id="tool-pan" data-tool-name="pan" autocomplete="off">
<span class="fa fa-hand-paper"></span><span class="tool-text"> Pan</span> <span class="fa fa-hand-paper"></span><span class="tool-text"> Pan</span>
</label> </label>
<label class="btn btn-lg btn-primary" title="Dessin libre (D)"> <label class="btn btn-lg btn-primary" title="Dessin libre (D)">
<input type="radio" name="toolType" value="drawing" id="tool-drawing" data-tool-name="drawing"> <input type="radio" name="toolType" value="drawing" id="tool-drawing" data-tool-name="drawing" autocomplete="off">
<span class="fa fa-pencil-alt" data-fa-transform="flip-h"></span><span class="tool-text"> Dessin</span> <span class="fa fa-pencil-alt" data-fa-transform="flip-h"></span><span class="tool-text"> Dessin</span>
</label> </label>
<label class="btn btn-lg btn-primary" title="Lignes (L)"> <label class="btn btn-lg btn-primary" title="Lignes (L)">
<input type="radio" name="toolType" value="lines" id="tool-lines" data-tool-name="lines"> <input type="radio" name="toolType" value="lines" id="tool-lines" data-tool-name="lines" autocomplete="off">
<span class="icon-line"></span><span class="tool-text"> Lignes</span> <span class="icon-line"></span><span class="tool-text"> Lignes</span>
</label> </label>
<label class="btn btn-lg btn-primary" title="Cercle (C)"> <label class="btn btn-lg btn-primary" title="Cercle (C)">
<input type="radio" name="toolType" value="ellipse" id="tool-ellipse" data-tool-name="ellipse"> <input type="radio" name="toolType" value="ellipse" id="tool-ellipse" data-tool-name="ellipse" autocomplete="off">
<span class="far fa-circle"></span><span class="tool-text"> Cercle</span> <span class="far fa-circle"></span><span class="tool-text"> Cercle</span>
</label> </label>
<label class="btn btn-lg btn-primary" title="Rectangle (R)"> <label class="btn btn-lg btn-primary" title="Rectangle (R)">
<input type="radio" name="toolType" value="rectangle" id="tool-rectangle" data-tool-name="rectangle"> <input type="radio" name="toolType" value="rectangle" id="tool-rectangle" data-tool-name="rectangle" autocomplete="off">
<span class="far fa-square"></span><span class="tool-text"> Rectangle</span> <span class="far fa-square"></span><span class="tool-text"> Rectangle</span>
</label> </label>
<label class="btn btn-lg btn-primary" title="Flèche (F)"> <label class="btn btn-lg btn-primary" title="Flèche (F)">
<input type="radio" name="toolType" value="arrow" id="tool-arrow" data-tool-name="arrow"> <input type="radio" name="toolType" value="arrow" id="tool-arrow" data-tool-name="arrow" autocomplete="off">
<span class="fa fa-arrow-right"></span><span class="tool-text"> Flèche</span> <span class="fa fa-arrow-right"></span><span class="tool-text"> Flèche</span>
</label> </label>
<label class="btn btn-lg btn-primary" title="Texte (T)"> <label class="btn btn-lg btn-primary" title="Texte (T)">
<input type="radio" name="toolType" value="text" id="tool-text" data-tool-name="text"> <input type="radio" name="toolType" value="text" id="tool-text" data-tool-name="text" autocomplete="off">
<span class="fa fa-font"></span><span class="tool-text"> Texte</span> <span class="fa fa-font"></span><span class="tool-text"> Texte</span>
</label> </label>
{% endblock draw-tool-tb %} {% endblock draw-tool-tb %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment