More fixes

This commit is contained in:
Julius Haertl
2016-07-05 02:28:15 +02:00
parent 68ff6571bd
commit 0330c01600
7 changed files with 158 additions and 39 deletions

View File

@@ -470,6 +470,24 @@ app.directive('cardActionUtils', function () {
});
// original idea from blockloop: http://stackoverflow.com/a/24090733
app.directive('elastic', [
'$timeout',
function($timeout) {
return {
restrict: 'A',
link: function($scope, element) {
$scope.initialHeight = $scope.initialHeight || element[0].style.height;
var resize = function() {
element[0].style.height = $scope.initialHeight;
element[0].style.height = "" + element[0].scrollHeight + "px";
};
element.on("input change", resize);
$timeout(resize, 0);
}
};
}
]);
app.factory('ApiService', ["$http", "$q", function($http, $q){
var ApiService = function(http, endpoint) {
this.endpoint = endpoint;