Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarincev committed Feb 16, 2017
2 parents 4166e03 + 0913299 commit 80bedb8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 27 deletions.
39 changes: 14 additions & 25 deletions VirtoCommerce.OrderModule.Web/Scripts/blades/operation-comment.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
angular.module('virtoCommerce.orderModule')
.controller('virtoCommerce.orderModule.orderOperationCommentDetail', ['$scope', 'platformWebApp.dialogService', function ($scope, dialogService) {

function initializeBlade() {

$scope.blade.origEntity = $scope.blade.currentEntity.comment;
$scope.blade.isLoading = false;
};
.controller('virtoCommerce.orderModule.orderOperationCommentDetail', ['$scope', function ($scope) {
var blade = $scope.blade;

function isDirty() {
return $scope.blade.currentEntity.comment !== $scope.blade.origEntity;
};
function initializeBlade() {
blade.origEntity = blade.currentEntity;
blade.currentEntity = angular.copy(blade.origEntity.comment);
blade.isLoading = false;
}

$scope.setForm = function (form) {
$scope.formScope = form;
}
$scope.cancelChanges = function () { $scope.bladeClose(); };

$scope.cancelChanges = function () {
$scope.bladeClose();
}
$scope.isValid = function () { return true; };

$scope.isValid = function () {
return $scope.formScope && $scope.formScope.$valid;
}
$scope.saveChanges = function () {
blade.origEntity.comment = blade.currentEntity;
$scope.bladeClose();
};

$scope.saveChanges = function () {
$scope.blade.origEntity = $scope.blade.currentEntity.comment;
$scope.bladeClose();
};

initializeBlade();
initializeBlade();
}]);
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<div class="blade-inner">
<div class="inner-block">
<form class="form" name="commentForm">
<div class="form-group" ng-init="setForm(commentForm)">
<div class="form-group">
<label class="form-label">{{ 'orders.blades.operation-comment.labels.comments' | translate }}</label>
<div class="form-input">
<textarea class="__large" ng-model="blade.currentEntity.comment" cols="30" rows="20"></textarea>
<textarea class="__large" ng-model="blade.currentEntity" cols="30" rows="20"></textarea>
</div>
</div>
</form>
Expand Down
2 changes: 2 additions & 0 deletions VirtoCommerce.OrderModule.Web/Scripts/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ angular.module(moduleName, ['virtoCommerce.catalogModule', 'virtoCommerce.pricin
template: 'Modules/$(VirtoCommerce.Orders)/Scripts/widgets/operation-comment-widget.tpl.html'
};
widgetService.registerWidget(operationCommentWidget, 'customerOrderDetailWidgets');
widgetService.registerWidget(operationCommentWidget, 'shipmentDetailWidgets');
widgetService.registerWidget(operationCommentWidget, 'paymentDetailWidgets');

var shipmentAddressWidget = {
controller: 'virtoCommerce.orderModule.shipmentAddressWidgetController',
Expand Down

0 comments on commit 80bedb8

Please sign in to comment.