diff options
author | 2017-09-01 11:57:47 +0800 | |
---|---|---|
committer | 2017-09-01 11:57:58 +0800 | |
commit | 57dbba269d19bc59fad89160200bb2dbcccb9003 (patch) | |
tree | d466041ceffa2161124ca79a48b3e077777c74b8 /usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js | |
parent | 4ff32341a0af1972b44a7410e76e9b231131e7ab (diff) |
Upload Monitor function code
Change-Id: I33ad76221b4cb771a298ff240245fc24be664efb
Issue-Id: USECASEUI-6
Signed-off-by: shentao <shentao@chinamobile.com>
Diffstat (limited to 'usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js')
-rw-r--r-- | usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js b/usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js new file mode 100644 index 00000000..cb85ffce --- /dev/null +++ b/usecaseui-common/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js @@ -0,0 +1,57 @@ + +angular.module("template/modalsAndAlerts/window2.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("template/modalsAndAlerts/window.html", + "<div class=\"modalwrapper active {{windowClass}}\" ng-class=\"{'modal-landscape': isModalLandscape}\" role=\"dialog\" tabindex=\"-1\" aria-labelledby=\"{{title}}\" aria-describedby=\"{{content}}\">\n" + + " <div class=\"modal fade {{sizeClass}}\">sdfdsfsfd</div>\n" + + "</div>"); + }]); + +angular.module('ddh.att.modalsAndAlerts') + +.controller('modalsAndAlertsController', function ($scope, $modal, $log) { + $scope.name='eeee'; + $scope.items = ['item1', 'item2', 'item3']; + $scope.dt = new Date("March 10, 2014 00:00:00"); + $scope.helperText = "The date you selected is $date. Double tap to open calendar. Select a date to close the calendar."; + $scope.open = function (event) { + var modalInstance = $modal.open({ + templateUrl: 'template/modalsAndAlerts/modal-demo.html', + controller: ModalInstanceCtrl, + sizeClass: 'modal-long-adjust', + resolve: { + items: function () { + return $scope.items; + } + } + }); + + modalInstance.result.then(function (selectedItem) { + $scope.selected = selectedItem; + event.target.focus(); + }, function () { + $log.info('Modal dismissed at: ' + new Date()); + event.target.focus(); + }); + }; + $scope.ok = function () { + //add the ok functionality + console.log("ok"); + }; + $scope.cancel = function () { + //add the cancel functionality + console.log("cancel"); + }; +}) + +var ModalInstanceCtrl = function ($scope, $modalInstance, items) { + $scope.items = items; + $scope.selected = { + item: $scope.items[0] + }; + $scope.ok = function () { + $modalInstance.close($scope.selected.item); + }; + $scope.cancel = function () { + $modalInstance.dismiss('cancel'); + }; +}; |