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.
54 lines
1.3 KiB
54 lines
1.3 KiB
|
|
angular.module('zuykov')
|
|
|
|
.controller('ModalFormCtrl', ['$scope', '$modal', function ($scope, $modal) {
|
|
|
|
$scope.items = ['item1', 'item2', 'item3'];
|
|
|
|
$scope.animationsEnabled = true;
|
|
|
|
|
|
$scope.open = function (form_id) {
|
|
|
|
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', ['$scope', '$modalInstance', 'items', '$timeout', function ($scope, $modalInstance, items, $timeout) {
|
|
|
|
|
|
$timeout(function () {
|
|
$('.forms').djangocms_forms();
|
|
}, 1000);
|
|
|
|
|
|
$scope.ok = function () {
|
|
$modalInstance.close("params");
|
|
};
|
|
|
|
$scope.cancel = function () {
|
|
$modalInstance.dismiss('cancel');
|
|
};
|
|
}]); |