You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

52 lines
1.3 KiB

angular.module('zuykov').controller('ModalFormCtrl', function ($scope, $modal, $log) {
$scope.items = ['item1', 'item2', 'item3'];
$scope.animationsEnabled = true;
$scope.open = function (form_id) {
console.log('open');
var modalInstance = $modal.open({
animation: $scope.animationsEnabled,
templateUrl: 'modalFormTemplate-' + form_id + '.html',
controller: 'ModalFormInstanceCtrl',
resolve: {
items: function () {
return $scope.items;
}
}
});
modalInstance.result.then(function (selectedItem) {
$scope.selected = selectedItem;
}, function () {
$log.info('Modal dismissed at: ' + new Date());
});
};
$scope.toggleAnimation = function () {
$scope.animationsEnabled = !$scope.animationsEnabled;
};
})
// Please note that $modalInstance represents a modal window (instance) dependency.
// It is not the same as the $modal service used above.
.controller('ModalFormInstanceCtrl', function ($scope, $modalInstance, items, $log, $timeout) {
$log.info('opened modal');
$timeout(function () {
$('.forms').djangocms_forms();
}, 1000);
$scope.ok = function () {
$modalInstance.close("params");
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
});