-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
69 lines (56 loc) · 2.74 KB
/
app.js
File metadata and controls
69 lines (56 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
angular.module('myApp', ['ui.bootstrap', 'as.sortable', 'ngSQLite'])
.controller('myCtrl', function($scope, $SQLite) {
var i;
$scope.itemsList = {
items1: [],
items2: []
};
var modal = document.getElementById('myModal');
$scope.itemsList.items1.push({ Id: 1, Label: 'Paid Link', Page: 'PaidLink' });
$scope.itemsList.items1.push({ Id: 4, Label: 'Organic Link', Page: 'OrganicLink' });
$scope.itemsList.items1.push({ Id: 3, Label: 'Paid Video', Page: 'PaidVideo' });
$scope.itemsList.items1.push({ Id: 2, Label: 'Organic Video', Page: 'OrganicVideo' });
$scope.itemsList.items1.push({ Id: 5, Label: 'Programmatic', Page: 'Programmatic' });
$scope.itemsList.items1.push({ Id: 6, Label: 'Sphere', Page: 'BestOfWeb' });
$scope.itemsList.items1.push({ Id: 7, Label: 'Subscriptions', Page: 'Subscriptions' });
$scope.itemsList.items1.push({ Id: 8, Label: 'Comments', Page: 'Comments' });
$scope.itemsList.items2.push({ Id: 9, Label: 'Placement', Page: 'Placement' });
$scope.sortableOptions = {
containment: '#sortable-container',
allowDuplicates: true
};
$scope.sortableCloneOptions = {
containment: '#sortable-container',
clone: true
};
$scope.closeItem = function(index) {
$scope.itemsList.items2.splice(index, 1);
}
$scope.items = ['item1', 'item2', 'item3'];
$scope.reset = function(ev) {
modal.style.display = "block";
}
$scope.close = function() {
modal.style.display = "none";
}
$scope.yes = function() {
$scope.itemsList.items2 = [];
$scope.itemsList.items2.push({ Id: 9, Label: 'Placement', Page: 'Placement' });
modal.style.display = "none";
localStorage.setItem('order', JSON.stringify($scope.itemsList.items2));
document.getElementById('render-frame').contentWindow.location.reload();
}
localStorage.removeItem('order');
$scope.save = function() {
localStorage.setItem('order', JSON.stringify($scope.itemsList.items2));
document.getElementById('render-frame').contentWindow.location.reload();
var iframe = document.getElementById('render-frame');
var childDocument = iframe.contentDocument ? iframe.contentDocument : iframe.contentWindow.document;
childDocument.documentElement.scrollTop = 0;
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
});