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
...@@ -150,9 +150,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -150,9 +150,8 @@ 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() {
$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');
}
}; };
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() {
$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.deliveryHeads = function() { $scope.deliveryHeads = function() {
......
...@@ -702,12 +702,23 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -702,12 +702,23 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}; };
$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.cancelDialog = function() {
$scope.cancelDialog = function() {
$mdDialog.hide('Cancelled'); $mdDialog.hide('Cancelled');
}; };
$scope.cancelTab = function() { $scope.cancelTab = function() {
removeTab("cancel"); removeTab("cancel");
......
...@@ -188,7 +188,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -188,7 +188,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
}); });
}; };
$scope.cancel = function() { $scope.cancel = function() {
$mdDialog.hide(); $mdDialog.hide();
}; };
$scope.viewTeamDetail = function(action, userData){ $scope.viewTeamDetail = function(action, userData){
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
...@@ -234,9 +234,8 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -234,9 +234,8 @@ 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() {
$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');
}
}; };
function updateGrid(action, record){ function updateGrid(action, record){
......
...@@ -176,8 +176,8 @@ myApp.controller("travelController",function($scope, myFactory, $mdDialog, $http ...@@ -176,8 +176,8 @@ myApp.controller("travelController",function($scope, myFactory, $mdDialog, $http
}); });
}; };
$scope.cancel = function() { $scope.cancel = function() {
$mdDialog.hide(); $mdDialog.hide();
}; };
$scope.viewTeamDetail = function(action, userData){ $scope.viewTeamDetail = function(action, userData){
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
...@@ -222,9 +222,8 @@ myApp.controller("travelController",function($scope, myFactory, $mdDialog, $http ...@@ -222,9 +222,8 @@ 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() {
$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');
}
}; };
function updateGrid(action, record){ function updateGrid(action, record){
......
...@@ -168,8 +168,8 @@ myApp.controller("visaController",function($scope, myFactory, $mdDialog, $http, ...@@ -168,8 +168,8 @@ myApp.controller("visaController",function($scope, myFactory, $mdDialog, $http,
}); });
}; };
$scope.cancel = function() { $scope.cancel = function() {
$mdDialog.hide(); $mdDialog.hide();
}; };
$scope.viewTeamDetail = function(action, userData){ $scope.viewTeamDetail = function(action, userData){
$('#home').addClass('md-scroll-mask'); $('#home').addClass('md-scroll-mask');
userData.action = action; userData.action = action;
...@@ -214,9 +214,8 @@ myApp.controller("visaController",function($scope, myFactory, $mdDialog, $http, ...@@ -214,9 +214,8 @@ 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() {
$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');
}
}; };
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