Skip to content

Commit

Permalink
Merge pull request #4 from chialin/removeAddOnSecondNode
Browse files Browse the repository at this point in the history
remove add botton on children node
  • Loading branch information
yurenju committed Jul 13, 2015
2 parents 76a2ca8 + 7d6a468 commit 340cc08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>{{title}}</h1>
<a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="removeItem(this)">
<span class="glyphicon glyphicon-remove"></span>
</a>
<a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="newSubItem(this)" style="margin-right: 8px;">
<a class="pull-right btn btn-primary btn-xs" data-nodrag ng-if="item.first" ng-click="newSubItem(this)" style="margin-right: 8px;">
<span class="glyphicon glyphicon-plus"></span>
</a>
</div>
Expand Down
4 changes: 3 additions & 1 deletion app/main-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ module.exports = function($http, $scope, SweetAlert) {
var current = {
url: line[0],
title: line[1],
items: []
items: [],
first: true
};
if (!current.url || current.url[0] !== ' ' || !firstLv) {
firstLv = current;
list.push(current);
} else {
current.url = current.url.trim();
current.first = false;
firstLv.items.push(current);
}
id++;
Expand Down

0 comments on commit 340cc08

Please sign in to comment.