Evan You 13 yıl önce
ebeveyn
işleme
16a4e05a34
4 değiştirilmiş dosya ile 5 ekleme ve 4 silme
  1. 2 1
      dev.html
  2. 0 1
      src/directive-parser.js
  3. 2 2
      src/seed.js
  4. 1 0
      src/textnode-parser.js

+ 2 - 1
dev.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 	<head>
-		<title>title</title>
+		<title>Todo</title>
 		<meta charset="utf-8">
 		<script src="dist/seed.js"></script>
 		<style type="text/css">
@@ -90,6 +90,7 @@
                 scope.removeTodo = function (e) {
                     var i = e.seed.eachIndex
                     scope.todos.splice(i, 1)
+                    scope.remaining -= e.seed.scope.done ? 0 : 1
                 }
 
                 scope.toggleTodo = function (e) {

+ 0 - 1
src/directive-parser.js

@@ -3,7 +3,6 @@ var config     = require('./config'),
     filters    = require('./filters')
 
 var KEY_RE          = /^[^\|]+/,
-    LOCAL_KEY_RE    = /\.[^.]+$/,
     ARG_RE          = /([^:]+):(.+)$/,
     FILTERS_RE      = /\|[^\|]+/g,
     FILTER_TOKEN_RE = /[^\s']+|'[^']+'/g,

+ 2 - 2
src/seed.js

@@ -112,8 +112,8 @@ Seed.prototype._compileNode = function (node, root) {
 
         if (!eachExp && !ctrlExp) {
             if (node.childNodes.length) {
-                slice.call(node.childNodes).forEach(function (child, i) {
-                    self._compileNode(child)       
+                slice.call(node.childNodes).forEach(function (child) {
+                    self._compileNode(child)
                 })
             }
         }

+ 1 - 0
src/textnode-parser.js

@@ -0,0 +1 @@
+module.exports = {}