Skip to content

Commit ba72c66

Browse files
committed
Update angular.js version in demo to 1.6.10
1 parent d78f672 commit ba72c66

File tree

4 files changed

+42
-41
lines changed

4 files changed

+42
-41
lines changed

demo/common/script.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
angular.module('app', ['gridster', 'ui.bootstrap', 'ngRoute'])
3+
.config(['$routeProvider',
4+
function($routeProvider) {
5+
$routeProvider
6+
.when('/main', {
7+
templateUrl: 'demo/main/view.html',
8+
controller: 'MainCtrl'
9+
})
10+
.when('/dashboard', {
11+
templateUrl: 'demo/dashboard/view.html',
12+
controller: 'DashboardCtrl'
13+
})
14+
.otherwise({
15+
redirectTo: '/main'
16+
});
17+
}
18+
])
19+
.controller('RootCtrl', function($scope) {
20+
$scope.$on('$locationChangeStart', function(e, next, current) {
21+
$scope.page = next.split('/').splice(-1);
22+
$scope.styleUrl = 'demo/' + $scope.page + '/style.css'
23+
});
24+
});

demo/dashboard/script.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ angular.module('app')
1010
}
1111
};
1212

13+
$scope.visible = false;
14+
1315
$scope.dashboards = {
1416
'1': {
1517
id: '1',
@@ -73,7 +75,7 @@ angular.module('app')
7375
}
7476
])
7577

76-
.controller('CustomWidgetCtrl', ['$scope', '$modal',
78+
.controller('CustomWidgetCtrl', ['$scope', '$uibModal',
7779
function($scope, $modal) {
7880

7981
$scope.remove = function(widget) {
@@ -96,7 +98,7 @@ angular.module('app')
9698
}
9799
])
98100

99-
.controller('WidgetSettingsCtrl', ['$scope', '$timeout', '$rootScope', '$modalInstance', 'widget',
101+
.controller('WidgetSettingsCtrl', ['$scope', '$timeout', '$rootScope', '$uibModalInstance', 'widget',
100102
function($scope, $timeout, $rootScope, $modalInstance, widget) {
101103
$scope.widget = widget;
102104

demo/dashboard/view.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
<h1 style="display: inline-block; width: 200px;">Dashboard</h1>
55
<select class="form-control" style="width: 150px; margin-bottom: 20px; display:inline-block;" ng-change="changeDashboard()" ng-model="selectedDashboardId" ng-options="d.id as d.name for d in dashboards | object2Array | orderBy:'id'">
66
</select>
7-
87
</div>
9-
<div gridster="gridsterOptions">
8+
<div gridster="gridsterOptions" ng-show="visible">
109
<ul>
1110
<li gridster-item="widget" ng-repeat="widget in dashboard.widgets">
1211
<div class="box" ng-controller="CustomWidgetCtrl">
@@ -22,4 +21,6 @@ <h3>{{ widget.name }}</h3>
2221
</div>
2322
</li>
2423
</ul>
25-
</div>
24+
</div>
25+
<hr>
26+
<button ng-click="visible=!visible">toggle</button>

index.html

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,24 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33

44
<head>
55
<meta charset="utf-8" />
66
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
77
<title>Angular Gridster</title>
8-
<meta name="description" content="" />
8+
<meta name="description" content="Angular Gridster" />
99
<meta name="viewport" content="width=device-width" />
1010

11-
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.css" rel="stylesheet">
11+
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.css">
1212
<link rel="stylesheet" href="dist/angular-gridster.min.css" />
1313
<link rel="stylesheet" href="demo/common/style.css" />
1414

15-
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>
16-
<script src="https://code.angularjs.org/1.2.15/angular-route.min.js"></script>
17-
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.10.0/ui-bootstrap-tpls.min.js"></script>
15+
<script src="https://cdn.bootcss.com/angular.js/1.6.10/angular.js"></script>
16+
<script src="https://cdn.bootcss.com/angular.js/1.6.10/angular-route.js"></script>
17+
<script src="https://cdn.bootcss.com/angular-ui-bootstrap/2.5.0/ui-bootstrap-tpls.js"></script>
1818

1919
<script src="src/angular-gridster.js"></script>
2020

21-
<script type="text/javascript">
22-
(function() {
23-
angular.module('app', ['gridster', 'ui.bootstrap', 'ngRoute'])
24-
.config(['$routeProvider',
25-
function($routeProvider) {
26-
$routeProvider
27-
.when('/main', {
28-
templateUrl: 'demo/main/view.html',
29-
controller: 'MainCtrl'
30-
})
31-
.when('/dashboard', {
32-
templateUrl: 'demo/dashboard/view.html',
33-
controller: 'DashboardCtrl'
34-
})
35-
.otherwise({
36-
redirectTo: '/main'
37-
});
38-
}
39-
])
40-
.controller('RootCtrl', function($scope) {
41-
$scope.$on('$locationChangeStart', function(e, next, current) {
42-
$scope.page = next.split('/').splice(-1);
43-
$scope.styleUrl = 'demo/' + $scope.page + '/style.css'
44-
});
45-
});
46-
})();
47-
</script>
21+
<script type="text/javascript" src="demo/common/script.js"></script>
4822

4923
<script src="demo/main/script.js"></script>
5024
<script src="demo/dashboard/script.js"></script>
@@ -59,9 +33,9 @@
5933
<a class="navbar-brand" href="#">Angular Gridster</a>
6034
</div>
6135
<ul class="nav navbar-nav navbar-right">
62-
<li ng-class="{active: page == 'main'}"><a href="#/main">Main Demo</a>
36+
<li ng-class="{active: page == 'main'}"><a href="#!/main">Main Demo</a>
6337
</li>
64-
<li ng-class="{active: page == 'dashboard'}"><a href="#/dashboard">Dashboard Demo</a>
38+
<li ng-class="{active: page == 'dashboard'}"><a href="#!/dashboard">Dashboard Demo</a>
6539
</li>
6640
<li><a>|</a>
6741
</li>
@@ -76,4 +50,4 @@
7650
</div>
7751
</body>
7852

79-
</html>
53+
</html>

0 commit comments

Comments
 (0)