diff --git a/nodejs/public/javascripts/angularApp.js b/nodejs/public/javascripts/angularApp.js index f614cb2..cdb6926 100644 --- a/nodejs/public/javascripts/angularApp.js +++ b/nodejs/public/javascripts/angularApp.js @@ -163,13 +163,22 @@ app.controller('MainCtrl', [ $scope.irTest = arduino.irTest; $scope.newrc = angular.copy(arduino.emptyrc); - $scope.modal={ - shown: false + $scope.modal = { + shown: false, + delete: false }; - $scope.toggleModal = function() { + $scope.toggleModal = function(RC) { + if(RC) { + $scope.newrc = RC; + $scope.newrc.tristate = RC.tristate > 0; + $scope.modal.delete = true; + } else { + $scope.modal.delete = false; + $scope.newrc = angular.copy(arduino.emptyrc); + } + $scope.modal.shown = !$scope.modal.shown; - $scope.newrc = angular.copy(arduino.emptyrc); }; $scope.addRC = function(){ @@ -179,9 +188,7 @@ app.controller('MainCtrl', [ } $scope.deleteRC = function(RC) { - $scope.newrc = RC; - $scope.modal.shown = !$scope.modal.shown; - console.log($scope.newrc); + } }]); diff --git a/nodejs/public/stylesheets/style.css b/nodejs/public/stylesheets/style.css index 8664fa4..cab715f 100644 --- a/nodejs/public/stylesheets/style.css +++ b/nodejs/public/stylesheets/style.css @@ -74,6 +74,16 @@ nav li img { color: #33C3F0; } +.button-primary.red { + border: #e9165c 1px solid; + background-color: #e9165c; +} + +.button-primary.red:hover { + border: #c4124d 1px solid; + background-color: #c4124d; +} + /* Modal */ .ng-modal { width: 85% !important; diff --git a/nodejs/views/index.ejs b/nodejs/views/index.ejs index 965f7f9..8163900 100644 --- a/nodejs/views/index.ejs +++ b/nodejs/views/index.ejs @@ -48,6 +48,7 @@ + @@ -61,7 +62,7 @@ - {{RC.name}} + {{RC.name}}