Kaynağa Gözat

Changes in Todo.APP (example)

@soyjavi 14 yıl önce
ebeveyn
işleme
d49fbe2d37
2 değiştirilmiş dosya ile 16 ekleme ve 16 silme
  1. 4 4
      examples/todo.js/app/view.js
  2. 12 12
      examples/todo.js/index.html

+ 4 - 4
examples/todo.js/app/view.js

@@ -1,6 +1,6 @@
 App.View = (function(lng, App, undefined) {
 
-    lng.View.Template.create('pending-tmp', 
+    lng.View.Template.create('pending-tmp',
         '<li id="{{id}}">\
             <a href="#">\
                 <span class="icon check"></span>\
@@ -10,7 +10,7 @@ App.View = (function(lng, App, undefined) {
         </li>'
     );
 
-    lng.View.Template.create('list-tmp', 
+    lng.View.Template.create('list-tmp',
         '<li id="{{id}}">\
             <a href="#">\
                 <span class="icon folder"></span>\
@@ -22,8 +22,8 @@ App.View = (function(lng, App, undefined) {
 
     var todo = function(id) {
         lng.Data.Sql.select('todo', {id:id}, function(result){
-            if (result.length > 0) {
-                var data = result[0];
+            if (result){
+                var data = result;
                 lng.Data.Cache.set('current_todo', data);
 
                 $('#txtEditName').val(data.name);

+ 12 - 12
examples/todo.js/index.html

@@ -18,13 +18,13 @@
     <link rel="apple-touch-icon-precomposed" href="assets/images/icon.png">
     <link rel="apple-touch-startup-image" href="assets/images/default.png">
     <!-- Main Stylesheet -->
-    <link rel="stylesheet" href="../../release/lungo-1.0.1.min.css">
+    <link rel="stylesheet" href="../../release/lungo-1.0.2.min.css">
     <link rel="stylesheet" href="../../release/lungo.theme.default.css">
     <!-- Sugars :) -->
     <link rel="stylesheet" href="assets/sugars/lungo.sugar.growl.css">
-</head> 
- 
-<body class="app">   
+</head>
+
+<body class="app">
     <section id="login" class="splash">
 		<article>
 			<h1>ToDo<span class="semi-opacity">.js</span></h1>
@@ -35,7 +35,7 @@
 			</div>
 			<div class="copyright">Copyright TapQuo Inc, 2011</div>
 		</article>
-	</section>   
+	</section>
 
 	<section id="main">
 		<header data-title="ToDo.js">
@@ -53,7 +53,7 @@
             </nav>
         </footer>
     </section>
-    
+
     <section id="view">
         <header data-back="home articblue" data-title="View ToDo's" >
             <a href="#" id="btnDoneTodo" class="button onright red" data-icon="check">&nbsp;Done</a>
@@ -99,12 +99,12 @@
 					</select>
 				</label>
 				<br/>
-				
+
 				<a href="#" id="btnNewTodo" class="button big articblue" data-icon="check">Add ToDo</a>
 				<a href="#back" data-target="section" class="button big red" data-icon="cancel">Cancel</a>
 			</p>
 		</article>
-	</section> 
+	</section>
 
 	<section id="settings">
 	    <header data-back="home articblue" data-title="Settings"></header>
@@ -112,7 +112,7 @@
 	        <p class="form">
     	        <label>Your name:</label>
     			<input type="text" id="txtName" placeholder="Type your name"/>
-			
+
     	        <label>Available task types:</label>
     	        <input type="text" id="txtType" placeholder="Type new type of task"/>
     			<label class="select">
@@ -128,13 +128,13 @@
 	</section>
 
     <!-- LungoJS (Production mode) -->
-    <script src="../../release/lungo-1.0.1.packed.js"></script>
+    <script src="../../release/lungo-1.0.2.packed.js"></script>
     <script src="assets/sugars/lungo.sugar.growl.js"></script>
-    <!-- LungoJS - Sandbox App -->    
+    <!-- LungoJS - Sandbox App -->
     <script src="app/app.js"></script>
     <script src="app/data.js"></script>
     <script src="app/events.js"></script>
     <script src="app/services.js"></script>
     <script src="app/view.js"></script>
-</body> 
+</body>
 </html>