From b15555e5e2132cb3b018f62cba87103ef3d22efd Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Tue, 20 Jun 2017 22:59:03 +0200 Subject: [PATCH] added save and cancel button Signed-off-by: Artem Anufrij --- css/style.css | 6 +++++- js/controller/ListController.js | 12 ++++++++++++ templates/part.boardlist.php | 13 ++++++------- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/css/style.css b/css/style.css index 689e7bbda..5d7405993 100644 --- a/css/style.css +++ b/css/style.css @@ -531,7 +531,7 @@ button.button-inline:hover { background-color: #f0f0f0; } -.icon-close { +#app-sidebar .icon-close { position: absolute; top: 5px; right: 5px; @@ -811,6 +811,10 @@ button.button-inline:hover { margin-top: 5px; } +#boardlist .board-edit-controls { + float: right; +} + /** * Board details */ diff --git a/js/controller/ListController.js b/js/controller/ListController.js index c4b76388e..61df6f6da 100644 --- a/js/controller/ListController.js +++ b/js/controller/ListController.js @@ -33,6 +33,7 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ $scope.colors = ['0082c9', '00c9c6','00c906', 'c92b00', 'F1DB50', '7C31CC', '3A3B3D', 'CACBCD']; $scope.boardservice = BoardService; $scope.newBoard.color = $scope.colors[0]; + $scope.updatingBoard = null; // FIXME: not nice, but we want to load this only once if($element.attr('id') === 'app-navigation') { @@ -104,6 +105,17 @@ app.controller('ListController', function ($scope, $location, $filter, BoardServ board.status.edit = false; }; + $scope.boardUpdateBegin = function(board) { + $scope.updatingBoard = board; + }; + + $scope.boardUpdateReset = function(board) { + board.title = $scope.updatingBoard.title; + board.color = $scope.updatingBoard.color; + $scope.filterData(); + board.status.edit = false; + }; + $scope.boardArchive = function (board) { board.archived = true; BoardService.update(board).then(function(data) { diff --git a/templates/part.boardlist.php b/templates/part.boardlist.php index eb6c9bb53..73b55c8da 100644 --- a/templates/part.boardlist.php +++ b/templates/part.boardlist.php @@ -28,7 +28,6 @@
-

@@ -43,18 +42,14 @@
-