Skip to content

Commit

Permalink
Items can be moved to collapsed columns with new context menu item.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiswa committed Nov 25, 2014
1 parent 31e5d94 commit 3e91125
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Changelog
* Uploaded files show username immediately
* Multiple concurrent logins are now possible
* Animations can be disabled per user
* Items can be dropped onto collapsed columns
* Items can be moved to collapsed columns with new context menu item

16 changes: 16 additions & 0 deletions js/controllers/boards.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ function ($scope, $routeParams, $location, $interval, $window,
$scope.deleteItem();
};

$scope.changeItemLane = function() {
$scope.itemFormData.loadItem($scope.contextItem);
$scope.itemFormData.isAdd = false;

$scope.submitItem($scope.itemFormData);
};

$scope.contextItem = {}; // Needs to exist prior to onContextMenu call.
$scope.onContextMenu = function(laneId, item) {
$scope.contextItem = item;
Expand Down Expand Up @@ -198,6 +205,15 @@ function ($scope, $routeParams, $location, $interval, $window,
// This is not the Angular way.
$scope.updateSortables = function() {
var that = this.$parent;
$('.columnHeader').sortable({
connectWith: '.itemContainer',
change: function() {
alert('change');
},
stop: function() {
alert('stop');
}
});
$('.itemContainer').sortable({
connectWith: '.itemContainer',
placeholder: 'draggable-placeholder',
Expand Down
1 change: 1 addition & 0 deletions js/controllers/boardsItemForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ function ($scope, BoardService) {
});
}
};
$scope.$parent.submitItem = $scope.submitItem;

var isSuccess = function(data) {
$scope.alerts.showAlerts(data.alerts);
Expand Down
11 changes: 10 additions & 1 deletion partials/board.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h3><span class="fa fa-exclamation-triangle"></span> Error Loading Board</h3>
<div class="boardColumn" data-ng-repeat="lane in currentBoard.ownLane | orderBy:'position':false"
data-ng-class="{'collapsed': lane.collapsed}" data-lane-id="{{ lane.id }}"
data-context-menu="onContextMenu(lane.id)" data-target="laneMenu">
<h3>{{ lane.name }}
<h3 class="columnHeader">{{ lane.name }}
<span class="badge" title="Column Items" data-ng-if="lane.collapsed">
{{ lane.ownItem.length || 0 }}
</span>
Expand Down Expand Up @@ -105,6 +105,15 @@ <h4>{{ item.title }}</h4>
</a>
</li>
<li role="presentation" class="divider"></li>
<li role="presentation">
Move to Column:<br />
<select class="form-control"
data-ng-model="contextItem.lane_id"
data-ng-change="changeItemLane()"
data-ng-options="lane.id as lane.name for lane in currentBoard.ownLane | orderBy:'position':false">
</select>
</li>
<li role="presentation" class="divider"></li>
<li role="presentation">
<a role="menuitem" style="cursor: default" data-ng-click="openAddItem()">
Add New Item
Expand Down

0 comments on commit 3e91125

Please sign in to comment.