diff --git a/examples/cordova/platforms/ios/www/css/index.css b/examples/cordova/platforms/ios/www/css/index.css
index 28b78203..74a58070 100644
--- a/examples/cordova/platforms/ios/www/css/index.css
+++ b/examples/cordova/platforms/ios/www/css/index.css
@@ -49,10 +49,30 @@ body {
height:100%; /* text area height */
width:100%; /* text area width */
padding:34px 10px 10px 10px;
- text-align:center;
+ text-align:left;
margin:0px;
}
+.todoContainer {
+ overflow: auto;
+}
+
+.todoContainer:after {
+ content: "";
+ display: table;
+ float: none;
+}
+
+.todoItem {
+ display: inline-block;
+}
+
+.deleteButton {
+ float:right;
+ margin-right: 20px;
+}
+
+
/* Landscape layout (with min-width) */
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
.app {
diff --git a/examples/cordova/platforms/ios/www/index.html b/examples/cordova/platforms/ios/www/index.html
index 307981b0..7a434bc2 100644
--- a/examples/cordova/platforms/ios/www/index.html
+++ b/examples/cordova/platforms/ios/www/index.html
@@ -28,7 +28,7 @@
* Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
-->
-
+
diff --git a/examples/cordova/platforms/ios/www/js/index.js b/examples/cordova/platforms/ios/www/js/index.js
index 35ca6ecb..7ea98511 100644
--- a/examples/cordova/platforms/ios/www/js/index.js
+++ b/examples/cordova/platforms/ios/www/js/index.js
@@ -29,11 +29,19 @@ function realm() {
return new Realm({schema: [Todo]});
}
+function deleteTodo(index) {
+ realm().write(function() {
+ realm().delete(realm().objects("Todo")[index]);
+ });
+ updateItems();
+}
+
function updateItems() {
var itemsHTML = "";
var todos = realm().objects("Todo");
for (var todo in todos) {
- itemsHTML += "
" + todos[todo].text + "
";
+ itemsHTML += "" + todos[todo].text +
+ "
";
}
var items = document.getElementById('items');
diff --git a/examples/cordova/www/css/index.css b/examples/cordova/www/css/index.css
index 28b78203..74a58070 100644
--- a/examples/cordova/www/css/index.css
+++ b/examples/cordova/www/css/index.css
@@ -49,10 +49,30 @@ body {
height:100%; /* text area height */
width:100%; /* text area width */
padding:34px 10px 10px 10px;
- text-align:center;
+ text-align:left;
margin:0px;
}
+.todoContainer {
+ overflow: auto;
+}
+
+.todoContainer:after {
+ content: "";
+ display: table;
+ float: none;
+}
+
+.todoItem {
+ display: inline-block;
+}
+
+.deleteButton {
+ float:right;
+ margin-right: 20px;
+}
+
+
/* Landscape layout (with min-width) */
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
.app {
diff --git a/examples/cordova/www/index.html b/examples/cordova/www/index.html
index 307981b0..7a434bc2 100644
--- a/examples/cordova/www/index.html
+++ b/examples/cordova/www/index.html
@@ -28,7 +28,7 @@
* Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
-->
-
+
diff --git a/examples/cordova/www/js/index.js b/examples/cordova/www/js/index.js
index 35ca6ecb..7ea98511 100644
--- a/examples/cordova/www/js/index.js
+++ b/examples/cordova/www/js/index.js
@@ -29,11 +29,19 @@ function realm() {
return new Realm({schema: [Todo]});
}
+function deleteTodo(index) {
+ realm().write(function() {
+ realm().delete(realm().objects("Todo")[index]);
+ });
+ updateItems();
+}
+
function updateItems() {
var itemsHTML = "";
var todos = realm().objects("Todo");
for (var todo in todos) {
- itemsHTML += "" + todos[todo].text + "
";
+ itemsHTML += "" + todos[todo].text +
+ "
";
}
var items = document.getElementById('items');