Commit 5090136e authored by nakavaram-nisum-com's avatar nakavaram-nisum-com Committed by rbonthala-nisum-com

MT-92 Error message or Warning message (#51)

parent afdeb36f
...@@ -152,7 +152,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -152,7 +152,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.cancel = function() { $scope.cancel = function() {
$mdDialog.hide(); $mdDialog.hide();
}; };
$scope.deleteRole = function(row){ $scope.deleteRole = function(row){
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
var confirm = $mdDialog.confirm() var confirm = $mdDialog.confirm()
...@@ -167,7 +166,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -167,7 +166,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
console.log("Cancelled dialog"); console.log("Cancelled dialog");
}); });
}; };
function deleteUserRole(empId){ function deleteUserRole(empId){
var req = { var req = {
method : 'DELETE', method : 'DELETE',
...@@ -373,9 +371,20 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -373,9 +371,20 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}; };
$scope.cancel = function() { $scope.cancel = function() {
if(this.myForm.$dirty){
$mdDialog.show($mdDialog.confirm({
skipHide: true,
textContent: 'Are you sure you want to cancel this?',
ok: 'ok',
cancel:'cancel'
})).then(function(){
$mdDialog.hide('Cancelled'); $mdDialog.hide('Cancelled');
})
}
else{
$mdDialog.hide('Cancelled');
}
}; };
function updateGrid(action, record){ function updateGrid(action, record){
if($scope.alertMsg == ""){ if($scope.alertMsg == ""){
if($scope.result == "Success"){ if($scope.result == "Success"){
......
...@@ -256,7 +256,19 @@ myApp.controller("domainController", ...@@ -256,7 +256,19 @@ myApp.controller("domainController",
}; };
$scope.cancel = function() { $scope.cancel = function() {
if(this.myForm.$dirty){
$mdDialog.show($mdDialog.confirm({
skipHide: true,
textContent: 'Are you sure you want to cancel this?',
ok: 'ok',
cancel:'cancel'
})).then(function(){
$mdDialog.hide('Cancelled'); $mdDialog.hide('Cancelled');
})
}
else{
$mdDialog.hide('Cancelled');
}
}; };
$scope.deliveryHeads = function() { $scope.deliveryHeads = function() {
......
...@@ -702,9 +702,20 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -702,9 +702,20 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}; };
$scope.cancel = function () { $scope.cancel = function () {
if(this.myForm.$dirty){
$mdDialog.show($mdDialog.confirm({
skipHide: true,
textContent: 'Are you sure you want to cancel this?',
ok: 'ok',
cancel:'cancel'
})).then(function(){
$mdDialog.hide('Cancelled'); $mdDialog.hide('Cancelled');
})
}
else{
$mdDialog.hide('Cancelled');
}
}; };
$scope.cancelDialog = function() { $scope.cancelDialog = function() {
$mdDialog.hide('Cancelled'); $mdDialog.hide('Cancelled');
}; };
......
...@@ -236,7 +236,6 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -236,7 +236,6 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
$scope.cancel = function() { $scope.cancel = function() {
$mdDialog.hide(); $mdDialog.hide();
}; };
$scope.deleteRole = function(row,id){ $scope.deleteRole = function(row,id){
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
var confirm = $mdDialog.confirm() var confirm = $mdDialog.confirm()
...@@ -716,7 +715,19 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -716,7 +715,19 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
}; };
$scope.cancel = function() { $scope.cancel = function() {
if(this.myForm.$dirty){
$mdDialog.show($mdDialog.confirm({
skipHide: true,
textContent: 'Are you sure you want to cancel this?',
ok: 'ok',
cancel:'cancel'
})).then(function(){
$mdDialog.hide('Cancelled');
})
}
else{
$mdDialog.hide('Cancelled'); $mdDialog.hide('Cancelled');
}
}; };
function updateGrid(action, record){ function updateGrid(action, record){
......
...@@ -224,7 +224,6 @@ myApp.controller("travelController",function($scope, myFactory, $mdDialog, $http ...@@ -224,7 +224,6 @@ myApp.controller("travelController",function($scope, myFactory, $mdDialog, $http
$scope.cancel = function() { $scope.cancel = function() {
$mdDialog.hide(); $mdDialog.hide();
}; };
$scope.deleteRole = function(row,id){ $scope.deleteRole = function(row,id){
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
var confirm = $mdDialog.confirm() var confirm = $mdDialog.confirm()
...@@ -453,7 +452,19 @@ myApp.controller("travelController",function($scope, myFactory, $mdDialog, $http ...@@ -453,7 +452,19 @@ myApp.controller("travelController",function($scope, myFactory, $mdDialog, $http
}; };
$scope.cancel = function() { $scope.cancel = function() {
if(this.myForm.$dirty){
$mdDialog.show($mdDialog.confirm({
skipHide: true,
textContent: 'Are you sure you want to cancel this?',
ok: 'ok',
cancel:'cancel'
})).then(function(){
$mdDialog.hide('Cancelled'); $mdDialog.hide('Cancelled');
})
}
else{
$mdDialog.hide('Cancelled');
}
}; };
function updateGrid(action, record){ function updateGrid(action, record){
......
...@@ -216,7 +216,6 @@ myApp.controller("visaController",function($scope, myFactory, $mdDialog, $http, ...@@ -216,7 +216,6 @@ myApp.controller("visaController",function($scope, myFactory, $mdDialog, $http,
$scope.cancel = function() { $scope.cancel = function() {
$mdDialog.hide(); $mdDialog.hide();
}; };
$scope.deleteRole = function(row,id){ $scope.deleteRole = function(row,id){
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
var confirm = $mdDialog.confirm() var confirm = $mdDialog.confirm()
...@@ -401,9 +400,20 @@ myApp.controller("visaController",function($scope, myFactory, $mdDialog, $http, ...@@ -401,9 +400,20 @@ myApp.controller("visaController",function($scope, myFactory, $mdDialog, $http,
}; };
$scope.cancel = function() { $scope.cancel = function() {
if(this.myForm.$dirty){
$mdDialog.show($mdDialog.confirm({
skipHide: true,
textContent: 'Are you sure you want to cancel this?',
ok: 'ok',
cancel:'cancel'
})).then(function(){
$mdDialog.hide('Cancelled');
})
}
else{
$mdDialog.hide('Cancelled'); $mdDialog.hide('Cancelled');
}
}; };
function updateGrid(action, record){ function updateGrid(action, record){
if($scope.alertMsg == ""){ if($scope.alertMsg == ""){
if($scope.result == "Success"){ if($scope.result == "Success"){
......
...@@ -160,7 +160,19 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -160,7 +160,19 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
$mdSelect.hide(); $mdSelect.hide();
} }
$scope.cancel = function(){ $scope.cancel = function(){
$mdDialog.hide("Cancelled"); if(this.myForm.$dirty){
$mdDialog.show($mdDialog.confirm({
skipHide: true,
textContent: 'Are you sure you want to cancel this?',
ok: 'ok',
cancel:'cancel'
})).then(function(){
$mdDialog.hide('Cancelled');
})
}
else{
$mdDialog.hide('Cancelled');
}
} }
$scope.updateSearch = function (e) { $scope.updateSearch = function (e) {
e.stopPropagation(); e.stopPropagation();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment