Skip to content

Commit

Permalink
chore: upgrade angular-bootstrap to 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassus committed Dec 23, 2013
1 parent a9cbb30 commit be49f6c
Show file tree
Hide file tree
Showing 22 changed files with 789 additions and 721 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"angular-sanitize": "1.2.6",

"angular-ui-select2": "~0.0.2",
"angular-bootstrap": "0.5.0",
"angular-bootstrap": "0.7.0",
"angular-strap": "9ci/angular-strap#fix-iso-dates",
"bootstrap-datepicker": "1.1.1",
"modernizr": "~2.6.2",
Expand Down
2 changes: 1 addition & 1 deletion grails/ag-plugin/AngleGrinderGrailsPlugin.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class AngleGrinderGrailsPlugin {

def version = '0.3.12'
def version = '0.3.13'
def grailsVersion = '2.0 > *'
def dependsOn = [:]
def pluginExcludes = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,18 +350,19 @@
var EditDialog, FormDialogCtrl, forms;
forms = angular.module("angleGrinder.forms");
FormDialogCtrl = function() {
FormDialogCtrl.$inject = [ "$scope", "$rootScope", "$log", "dialog", "serverValidationErrorsHandler", "item", "gridCtrl" ];
function FormDialogCtrl($scope, $rootScope, $log, dialog, serverValidationErrorsHandler, item, gridCtrl) {
FormDialogCtrl.$inject = [ "$scope", "$rootScope", "$log", "$modalInstance", "serverValidationErrorsHandler", "item", "gridCtrl" ];
function FormDialogCtrl($scope, $rootScope, $log, $modalInstance, serverValidationErrorsHandler, item, gridCtrl) {
$scope.item = item;
$scope.createNew = !item.persisted();
$scope.form = {};
$scope.closeEditDialog = function() {
$log.info("Closing the dialog");
return dialog.close($scope.item);
return $modalInstance.close($scope.item);
};
$scope.save = function(item) {
var onError, onSuccess;
if ($scope.editForm.$invalid) {
$log.warn("The form is invalid", $scope.editForm);
if ($scope.form.edit.$invalid) {
$log.warn("The form is invalid", $scope.form.edit);
return;
}
onSuccess = function(response) {
Expand All @@ -371,7 +372,7 @@
};
onError = function(response) {
$log.error("Something went wront", response);
return serverValidationErrorsHandler($scope.editForm, response, item.resourceName());
return serverValidationErrorsHandler($scope.form.edit, response, item.resourceName());
};
return item.save({
success: onSuccess,
Expand All @@ -398,18 +399,19 @@
}();
forms.controller("FormDialogCtrl", FormDialogCtrl);
EditDialog = function() {
EditDialog.$inject = [ "$dialog" ];
function EditDialog($dialog) {
this.$dialog = $dialog;
EditDialog.$inject = [ "$modal" ];
function EditDialog($modal) {
this.$modal = $modal;
}
EditDialog.prototype.open = function(templateUrl, item, gridCtrl) {
var dialog;
if (gridCtrl == null) {
gridCtrl = null;
}
dialog = this.$dialog.dialog({
backdropFade: false,
dialogFade: false,
return this.$modal.open({
backdrop: "static",
keyboard: false,
templateUrl: templateUrl,
controller: "FormDialogCtrl",
resolve: {
item: function() {
return item;
Expand All @@ -419,21 +421,6 @@
}
}
});
dialog.handledEscapeKey = function(e) {
if (e.which === 27) {
return dialog.handleBackDropClick(e);
}
};
dialog.handleBackDropClick = function(e) {
var formCtrl;
e.preventDefault();
formCtrl = dialog.$scope.editForm;
if (formCtrl != null && !formCtrl.$dirty) {
dialog.close();
return dialog.$scope.$apply();
}
};
return dialog.open(templateUrl, "FormDialogCtrl");
};
return EditDialog;
}();
Expand All @@ -444,12 +431,12 @@
var ConfirmationDialog, ConfirmationDialogCtrl, forms;
forms = angular.module("angleGrinder.forms");
ConfirmationDialogCtrl = function() {
ConfirmationDialogCtrl.$inject = [ "$scope", "$log", "dialog", "message" ];
function ConfirmationDialogCtrl($scope, $log, dialog, message) {
ConfirmationDialogCtrl.$inject = [ "$scope", "$log", "$modalInstance", "message" ];
function ConfirmationDialogCtrl($scope, $log, $modalInstance, message) {
$scope.message = message;
$scope.close = function(confirmed) {
$log.info("Confirmation dialog closed", confirmed);
return dialog.close(confirmed);
return $modalInstance.close(confirmed);
};
}
return ConfirmationDialogCtrl;
Expand All @@ -459,29 +446,27 @@
return $templateCache.put("templates/dialogs/confirmation.html", '<div class="modal-body">{{message}}</div>\n <div class="modal-footer">\n <button class="btn" ng-click="close(false)">Cancel</button>\n <button class="btn btn-primary" ng-click="close(true)">OK</button>\n</div>');
} ]);
ConfirmationDialog = function() {
ConfirmationDialog.$inject = [ "$dialog", "$log" ];
function ConfirmationDialog($dialog, $log) {
this.$dialog = $dialog;
ConfirmationDialog.$inject = [ "$modal", "$log" ];
function ConfirmationDialog($modal, $log) {
this.$modal = $modal;
this.$log = $log;
}
ConfirmationDialog.prototype.open = function(message) {
var dialog;
if (message == null) {
message = null;
message = "Are you sure?";
}
this.$log.info("Opening confirmation dialog, message:", message);
dialog = this.$dialog.dialog({
return this.$modal.open({
backdrop: true,
keyboard: true,
templateUrl: "templates/dialogs/confirmation.html",
controller: "ConfirmationDialogCtrl",
resolve: {
message: function() {
if (message != null) {
return message;
} else {
return "Are you sure?";
}
return message;
}
}
});
return dialog.open("templates/dialogs/confirmation.html", "ConfirmationDialogCtrl");
};
return ConfirmationDialog;
}();
Expand Down Expand Up @@ -522,7 +507,9 @@
return openEditDialogFor(resource);
};
return $scope.deleteItem = function(id) {
return confirmationDialog.open().then(function(confirmed) {
var modalInstance;
modalInstance = confirmationDialog.open();
return modalInstance.result.then(function(confirmed) {
var onError, onSuccess, promise;
if (!confirmed) {
return;
Expand Down Expand Up @@ -579,15 +566,16 @@
mixin = angular.module("angleGrinder.forms");
mixin.factory("massUpdateFormCtrlMixin", [ "$log", function($log) {
return function($scope, args) {
var Resource, dialog, grid, selectedIds;
var Resource, grid, modalInstance, selectedIds;
if (args == null) {
args = {};
}
dialog = args.dialog, Resource = args.Resource, selectedIds = args.selectedIds,
modalInstance = args.modalInstance, Resource = args.Resource, selectedIds = args.selectedIds,
grid = args.grid;
$scope.form = {};
$scope.massUpdate = function(records) {
var promise;
if ($scope.massUpdateForm.$invalid) {
if ($scope.form.massUpdate.$invalid) {
return;
}
$log.info("Mass updating records", records);
Expand Down Expand Up @@ -621,7 +609,7 @@
};
return $scope.closeDialog = function() {
$log.info("Closing the mass update dialog");
return dialog.close();
return modalInstance.close();
};
};
} ]);
Expand All @@ -630,7 +618,7 @@
(function() {
var mixin;
mixin = angular.module("angleGrinder.forms");
mixin.factory("massUpdateMixin", [ "$log", "$dialog", "pathWithContext", function($log, $dialog, pathWithContext) {
mixin.factory("massUpdateMixin", [ "$log", "$modal", "pathWithContext", function($log, $modal, pathWithContext) {
return function($scope, args) {
var controller, gridName, templateUrl;
if (args == null) {
Expand All @@ -641,7 +629,7 @@
controller = "MassUpdateFormCtrl";
}
return $scope.massUpdate = function() {
var dialog, grid, selectedIds;
var grid, selectedIds;
grid = $scope[gridName];
if (grid == null) {
throw new Error("the grid is not defined");
Expand All @@ -650,9 +638,11 @@
if (selectedIds.length === 0) {
return;
}
dialog = $dialog.dialog({
backdropFade: false,
dialogFade: false,
return $modal.open({
backdrop: "static",
keyboard: false,
templateUrl: pathWithContext(templateUrl),
controller: controller,
resolve: {
selectedIds: function() {
return selectedIds;
Expand All @@ -662,7 +652,6 @@
}
}
});
return dialog.open(pathWithContext(templateUrl), controller);
};
};
} ]);
Expand Down
Loading

0 comments on commit be49f6c

Please sign in to comment.