59 lines
2.0 KiB
Plaintext
59 lines
2.0 KiB
Plaintext
|
scotchApp.factory('commonFactory', function($modal) {
|
||
|
var factory = {};
|
||
|
|
||
|
factory.doOpenMsg = function(dataError){
|
||
|
var msgModal =$modal.open({
|
||
|
backdrop: 'static',
|
||
|
//backdropClick: true,
|
||
|
//dialogFade: true,
|
||
|
//keyboard: true,
|
||
|
templateUrl: doGetPath('/pages/msg.jsp'),
|
||
|
controller: 'msgController',
|
||
|
windowClass: 'app-modal-window-msg',
|
||
|
resolve: {
|
||
|
load: ['$q', '$rootScope', function ($q, $rootScope) {
|
||
|
var deferred = $q.defer();
|
||
|
require([doGetPath('/js/ctrl/msgController.js?v='+new Date().getTime())], function () {
|
||
|
$rootScope.$apply(function () {
|
||
|
deferred.resolve();
|
||
|
});
|
||
|
});
|
||
|
return deferred.promise;
|
||
|
}],
|
||
|
errorForm: function () {
|
||
|
return dataError;
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
return msgModal.result;
|
||
|
};
|
||
|
|
||
|
factory.doOpenConfirm = function(dataError){
|
||
|
var msgModal =$modal.open({
|
||
|
backdrop: 'static',
|
||
|
//backdropClick: true,
|
||
|
//dialogFade: true,
|
||
|
//keyboard: true,
|
||
|
templateUrl: doGetPath('/pages/msg_confirm.jsp'),
|
||
|
controller: 'msgController',
|
||
|
windowClass: 'app-modal-window-msg',
|
||
|
resolve: {
|
||
|
load: ['$q', '$rootScope', function ($q, $rootScope) {
|
||
|
var deferred = $q.defer();
|
||
|
require([doGetPath('/js/ctrl/msgController.js?v='+new Date().getTime())], function () {
|
||
|
$rootScope.$apply(function () {
|
||
|
deferred.resolve();
|
||
|
});
|
||
|
});
|
||
|
return deferred.promise;
|
||
|
}],
|
||
|
errorForm: function () {
|
||
|
return dataError;
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
return msgModal.result;
|
||
|
};
|
||
|
|
||
|
return factory;
|
||
|
});
|