Commit 04f52c8c authored by William's avatar William
Browse files

Added the change color functionnality

-changed the buttons inside the html to call their associated functions
- Made the functions inside the js
parent dd60abee
......@@ -13,9 +13,9 @@ ui-sref="project.workshops.overview">{{::_labels.disconnectWorkshopBtn}}
<canvas id="drawZone" width="500" height="500" style="border: thin solid black; margin: 0 auto"></canvas>
<div id="commands">
<input type="color" name="personnalized-color" id="personnalized-color">
<button>Black</button>
<button>Blue</button>
<button>Red</button>
<button ng-click="paperBoardCtrl.blackPaint()">Black</button>
<button ng-click="paperBoardCtrl.bluePaint()">Blue</button>
<button ng-click="paperBoardCtrl.redPaint()">Red</button>
<button>Cursor</button>
<button ng-click="paperBoardCtrl.penMode()">Pen</button>
<button>Circle</button>
......
......@@ -96,4 +96,29 @@ root.controller('PaperBoardCtrl', ['$scope', '$stateParams', '$http', '$state',
{
isDrawing = false;
});
document.querySelector('#personnalized-color').addEventListener('change', e =>
{
style = document.querySelector('#personnalized-color').value;
})
paperBoardCtrl.blackPaint = function ()
{
style = "#000";
document.querySelector('#personnalized-color').value = "#000";
}
paperBoardCtrl.bluePaint = function ()
{
style = "#0000FF";
document.querySelector('#personnalized-color').value = "#0000FF";
}
paperBoardCtrl.redPaint = function ()
{
style = "#FF0000";
document.querySelector('#personnalized-color').value = "#FF0000";
}
}]);
Markdown is supported
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