Commit new state

This commit is contained in:
Julius Haertl
2016-07-02 22:13:32 +02:00
parent dae1a9b3d4
commit 7a9489adf0
31 changed files with 884 additions and 97 deletions

View File

@@ -1,2 +1,28 @@
var app = angular.module('Deck', ['ngRoute', 'ngSanitize', 'ui.router', 'as.sortable']);
angular.module('markdown', [])
.provider('markdown', [function () {
var opts = {};
return {
config: function (newOpts) {
opts = newOpts;
},
$get: function () {
return new window.showdown.Converter(opts);
}
};
}])
.filter('markdown', ['markdown', function (markdown) {
return function (text) {
return markdown.makeHtml(text || '');
};
}]);
var app = angular.module('Deck', [
'ngRoute',
'ngSanitize',
'ui.router',
'ui.select',
'as.sortable',
'markdown',
'ngAnimate'
]);

View File

@@ -17,6 +17,14 @@ app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvid
templateUrl: "/board.html",
controller: 'BoardController'
})
.state('board.detail', {
url: "/detail/",
views: {
"sidebarView": {
templateUrl: "/board.sidebarView.html",
}
}
})
.state('board.card', {
url: "/card/:cardId",
views: {

View File

@@ -6,10 +6,16 @@ app.run(function ($document, $rootScope, $transitions) {
$transitions.onEnter({to: 'board.card'}, function ($state, $transition$) {
$rootScope.sidebar.show = true;
});
$transitions.onEnter({to: 'board.detail'}, function ($state, $transition$) {
$rootScope.sidebar.show = true;
});
$transitions.onEnter({to: 'board'}, function ($state) {
$rootScope.sidebar.show = false;
});
$transitions.onExit({from: 'board.card'}, function ($state) {
$rootScope.sidebar.show = false;
});
$transitions.onExit({from: 'board.detail'}, function ($state) {
$rootScope.sidebar.show = false;
});
});