diff --git a/nodejs/public/javascripts/angularApp.js b/nodejs/public/javascripts/angularApp.js
index 9ee2ed7..3202d62 100644
--- a/nodejs/public/javascripts/angularApp.js
+++ b/nodejs/public/javascripts/angularApp.js
@@ -114,7 +114,7 @@ app.factory('arduino', ['$http', 'auth', function($http, auth){
return $http.post('/sendRC', {code}, {
headers: {Authorization: 'Bearer '+auth.getToken()}
}).success(function (data) {
- RC.state = (RC.state) ? false : true;
+ RC.state = !RC.state;
});
}
@@ -177,11 +177,20 @@ app.controller('MainCtrl', [
$scope.sendRC = arduino.sendRC;
$scope.irTest = arduino.irTest;
- $scope.modalShown = false;
- $scope.toggleModal = function() {
- $scope.modalShown = !$scope.modalShown;
+ $scope.modal={
+ shown: false
};
+ $scope.toggleModal = function(rc) {
+ $scope.modal.shown = !$scope.modal.shown;
+ if(rc) {rc.name = rc.on = rc.off = rc.dec = '';}
+ };
+
+ $scope.addRC = function(rc){
+ $scope.modal.shown = !$scope.modal.shown;
+ rc.name = rc.on = rc.off = rc.dec = '';
+ }
+
}]);
app.controller('AuthCtrl', [
diff --git a/nodejs/public/stylesheets/style.css b/nodejs/public/stylesheets/style.css
index a63e25c..422d10f 100644
--- a/nodejs/public/stylesheets/style.css
+++ b/nodejs/public/stylesheets/style.css
@@ -8,6 +8,10 @@ td button, td .button {
font-weight: 600;
}
+.modal form {
+ display: inline;
+}
+
/* Navigation */
nav {
diff --git a/nodejs/views/index.ejs b/nodejs/views/index.ejs
index 8dea371..c3f4c28 100644
--- a/nodejs/views/index.ejs
+++ b/nodejs/views/index.ejs
@@ -33,7 +33,25 @@
-